MCPcopy Index your code
hub / github.com/googlemaps/google-maps-services-python / assertURLEqual

Method assertURLEqual

tests/__init__.py:25–35  ·  view source on GitHub ↗

Check that two arguments are equivalent URLs. Ignores the order of query arguments.

(self, first, second, msg=None)

Source from the content-addressed store, hash-verified

23
24class TestCase(unittest.TestCase):
25 def assertURLEqual(self, first, second, msg=None):
26 """Check that two arguments are equivalent URLs. Ignores the order of
27 query arguments.
28 """
29 first_parsed = urlparse(first)
30 second_parsed = urlparse(second)
31 self.assertEqual(first_parsed[:3], second_parsed[:3], msg)
32
33 first_qsl = sorted(parse_qsl(first_parsed.query))
34 second_qsl = sorted(parse_qsl(second_parsed.query))
35 self.assertEqual(first_qsl, second_qsl, msg)
36
37 def u(self, string):
38 """Create a unicode string, compatible across all versions of Python."""

Calls

no outgoing calls