gh-71339: Use new assertion methods in tests (GH-129046)

This commit is contained in:
Serhiy Storchaka 2025-05-22 13:17:22 +03:00 committed by GitHub
parent bb244fd33d
commit 2602d8ae98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
117 changed files with 407 additions and 445 deletions

View file

@ -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 [