mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-71339: Use new assertion methods in tests (GH-129046)
This commit is contained in:
parent
bb244fd33d
commit
2602d8ae98
117 changed files with 407 additions and 445 deletions
|
@ -1415,27 +1415,27 @@ class CommandLineTest(unittest.TestCase):
|
|||
def test_parse_args(self):
|
||||
args, help_text = random._parse_args(shlex.split("--choice a b c"))
|
||||
self.assertEqual(args.choice, ["a", "b", "c"])
|
||||
self.assertTrue(help_text.startswith("usage: "))
|
||||
self.assertStartsWith(help_text, "usage: ")
|
||||
|
||||
args, help_text = random._parse_args(shlex.split("--integer 5"))
|
||||
self.assertEqual(args.integer, 5)
|
||||
self.assertTrue(help_text.startswith("usage: "))
|
||||
self.assertStartsWith(help_text, "usage: ")
|
||||
|
||||
args, help_text = random._parse_args(shlex.split("--float 2.5"))
|
||||
self.assertEqual(args.float, 2.5)
|
||||
self.assertTrue(help_text.startswith("usage: "))
|
||||
self.assertStartsWith(help_text, "usage: ")
|
||||
|
||||
args, help_text = random._parse_args(shlex.split("a b c"))
|
||||
self.assertEqual(args.input, ["a", "b", "c"])
|
||||
self.assertTrue(help_text.startswith("usage: "))
|
||||
self.assertStartsWith(help_text, "usage: ")
|
||||
|
||||
args, help_text = random._parse_args(shlex.split("5"))
|
||||
self.assertEqual(args.input, ["5"])
|
||||
self.assertTrue(help_text.startswith("usage: "))
|
||||
self.assertStartsWith(help_text, "usage: ")
|
||||
|
||||
args, help_text = random._parse_args(shlex.split("2.5"))
|
||||
self.assertEqual(args.input, ["2.5"])
|
||||
self.assertTrue(help_text.startswith("usage: "))
|
||||
self.assertStartsWith(help_text, "usage: ")
|
||||
|
||||
def test_main(self):
|
||||
for command, expected in [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue