mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-71339: Use new assertion methods in the urllib tests (GH-129056)
This commit is contained in:
parent
7a29c9883f
commit
f98b9b4cbb
5 changed files with 13 additions and 20 deletions
|
@ -1164,14 +1164,13 @@ class UrlParseTestCase(unittest.TestCase):
|
|||
with self.subTest(url=url, function=func):
|
||||
result = func(url, allow_fragments=False)
|
||||
self.assertEqual(result.fragment, "")
|
||||
self.assertTrue(
|
||||
getattr(result, attr).endswith("#" + expected_frag))
|
||||
self.assertEndsWith(getattr(result, attr),
|
||||
"#" + expected_frag)
|
||||
self.assertEqual(func(url, "", False).fragment, "")
|
||||
|
||||
result = func(url, allow_fragments=True)
|
||||
self.assertEqual(result.fragment, expected_frag)
|
||||
self.assertFalse(
|
||||
getattr(result, attr).endswith(expected_frag))
|
||||
self.assertNotEndsWith(getattr(result, attr), expected_frag)
|
||||
self.assertEqual(func(url, "", True).fragment,
|
||||
expected_frag)
|
||||
self.assertEqual(func(url).fragment, expected_frag)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue