(self, bytes, url, defrag, frag, missing_as_none)
| 804 | ]) |
| 805 | @support.subTests('missing_as_none', (False, True)) |
| 806 | def test_urldefrag(self, bytes, url, defrag, frag, missing_as_none): |
| 807 | if bytes: |
| 808 | url = str_encode(url) |
| 809 | defrag = str_encode(defrag) |
| 810 | frag = str_encode(frag) |
| 811 | result = urllib.parse.urldefrag(url, missing_as_none=missing_as_none) |
| 812 | if not missing_as_none: |
| 813 | hash = '#' if isinstance(url, str) else b'#' |
| 814 | url = url.rstrip(hash) |
| 815 | if frag is None: |
| 816 | frag = url[:0] |
| 817 | self.assertEqual(result.geturl(), url) |
| 818 | self.assertEqual(result, (defrag, frag)) |
| 819 | self.assertEqual(result.url, defrag) |
| 820 | self.assertEqual(result.fragment, frag) |
| 821 | |
| 822 | def test_urlsplit_scoped_IPv6(self): |
| 823 | p = urllib.parse.urlsplit('http://[FE80::822a:a8ff:fe49:470c%tESt]:1234') |
nothing calls this directly
no test coverage detected