MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_urldefrag

Method test_urldefrag

Lib/test/test_urlparse.py:767–777  ·  view source on GitHub ↗
(self, bytes, url, defrag, frag)

Source from the content-addressed store, hash-verified

765 ('://a/b/c;p?q#f', '://a/b/c;p?q', 'f'),
766 ])
767 def test_urldefrag(self, bytes, url, defrag, frag):
768 if bytes:
769 url = str_encode(url)
770 defrag = str_encode(defrag)
771 frag = str_encode(frag)
772 result = urllib.parse.urldefrag(url)
773 hash = '#' if isinstance(url, str) else b'#'
774 self.assertEqual(result.geturl(), url.rstrip(hash))
775 self.assertEqual(result, (defrag, frag))
776 self.assertEqual(result.url, defrag)
777 self.assertEqual(result.fragment, frag)
778
779 def test_urlsplit_scoped_IPv6(self):
780 p = urllib.parse.urlsplit('http://[FE80::822a:a8ff:fe49:470c%tESt]:1234')

Callers

nothing calls this directly

Calls 5

str_encodeFunction · 0.85
isinstanceFunction · 0.85
assertEqualMethod · 0.45
geturlMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected