MCPcopy Index your code
hub / github.com/python/cpython / test_splitport

Method test_splitport

Lib/test/test_urlparse.py:1832–1841  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1830 self.assertEqual(splitpasswd(':ab'), ('', 'ab'))
1831
1832 def test_splitport(self):
1833 splitport = urllib.parse._splitport
1834 self.assertEqual(splitport('parrot:88'), ('parrot', '88'))
1835 self.assertEqual(splitport('parrot'), ('parrot', None))
1836 self.assertEqual(splitport('parrot:'), ('parrot', None))
1837 self.assertEqual(splitport('127.0.0.1'), ('127.0.0.1', None))
1838 self.assertEqual(splitport('parrot:cheese'), ('parrot:cheese', None))
1839 self.assertEqual(splitport('[::1]:88'), ('[::1]', '88'))
1840 self.assertEqual(splitport('[::1]'), ('[::1]', None))
1841 self.assertEqual(splitport(':88'), ('', '88'))
1842
1843 def test_splitnport(self):
1844 splitnport = urllib.parse._splitnport

Callers

nothing calls this directly

Calls 2

splitportFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected