def test_netloc(self, url, expected_netloc): assert parse_url(url).netloc == expected_netloc
def test_request_uri(self, url, expected_request_uri): returned_url = parse_url(url) assert returned_url.request_uri == expected_request_uri
def test_parse_url(self, url, expected_url): returned_url = parse_url(url) assert returned_url == expected_url
def test_parse_url_invalid_IPv6(self): with pytest.raises(ValueError): parse_url('[::1')
def test_parse_url_normalization(self, url, expected_normalized_url): """Assert parse_url normalizes the scheme/host, and only the scheme/host""" actual_normalized_url = parse_url(url).url assert actual_normalized_url == expected_normalized_url