mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
use assert[Not]In where appropriate
This commit is contained in:
parent
0f77f465ff
commit
b58e0bd8bb
39 changed files with 176 additions and 173 deletions
|
@ -731,7 +731,7 @@ class urlencode_Tests(unittest.TestCase):
|
|||
expect_somewhere = ["1st=1", "2nd=2", "3rd=3"]
|
||||
result = urllib.parse.urlencode(given)
|
||||
for expected in expect_somewhere:
|
||||
self.assertTrue(expected in result,
|
||||
self.assertIn(expected, result,
|
||||
"testing %s: %s not found in %s" %
|
||||
(test_type, expected, result))
|
||||
self.assertEqual(result.count('&'), 2,
|
||||
|
@ -778,8 +778,7 @@ class urlencode_Tests(unittest.TestCase):
|
|||
result = urllib.parse.urlencode(given, True)
|
||||
for value in given["sequence"]:
|
||||
expect = "sequence=%s" % value
|
||||
self.assertTrue(expect in result,
|
||||
"%s not found in %s" % (expect, result))
|
||||
self.assertIn(expect, result)
|
||||
self.assertEqual(result.count('&'), 2,
|
||||
"Expected 2 '&'s, got %s" % result.count('&'))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue