def test_url_unurlparse_equalto(self): try: from urlparse import urlunparse #PY2 except ImportError: from urllib.parse import urlunparse #PY3 test_url = Url("myurl.com") self.assertEqual( urlunparse((test_url.__scheme__, test_url.__hostname__, test_url._page_gen(), "", test_url._query_gen(), test_url.__fragment__)), str(test_url))
def test_url_unurlparse_equalto(self): try: from urlparse import urlunparse # PY2 except ImportError: from urllib.parse import urlunparse # PY3 test_url = Url("myurl.com") self.assertEqual( urlunparse( ( test_url.__scheme__, test_url.__hostname__, test_url._page_gen(), "", test_url._query_gen(), test_url.__fragment__, ) ), str(test_url), )
def test_page_gen_equalto(self): test_url = Url("myurl.com").page("HELLO") self.assertEqual(test_url._page_gen(), "/HELLO")
def test_page_gen_type(self): test_url = Url("myurl.com").page("HELLO") self.assertIsInstance(test_url._page_gen(), str)