def test_get_map(self, source, mock_http_client): source.get_map(MapQuery((-180, -90, 180, 90), (300, 150), SRS(4326))) assert query_eq( mock_http_client.requested[0], "http://localhost/service?" "layers=foo&width=300&version=1.1.1&bbox=-180,-90,180,90&service=WMS" "&format=image%2Fpng&styles=&srs=EPSG%3A4326&request=GetMap&height=150" )
def test_get_map(self): self.source.get_map(MapQuery((-180, -90, 180, 90), (300, 150), SRS(4326))) assert query_eq( self.http_client.requested[0], "http://localhost/service?" "layers=foo&width=300&version=1.1.1&bbox=-180,-90,180,90&service=WMS" "&format=image%2Fpng&styles=&srs=EPSG%3A4326&request=GetMap&height=150", )
def test_query_eq(): assert query_eq('?baz=42&foo=bar', '?foo=bar&baz=42') assert query_eq('?baz=42.00&foo=bar', '?foo=bar&baz=42.0') assert query_eq('?baz=42.000000001&foo=bar', '?foo=bar&baz=42.0') assert not query_eq('?baz=42.00000001&foo=bar', '?foo=bar&baz=42.0') assert query_eq('?baz=42.000000001,23.99999999999&foo=bar', '?foo=bar&baz=42.0,24.0') assert not query_eq('?baz=42.00000001&foo=bar', '?foo=bar&baz=42.0')
def test_str(self): query_eq( str(self.r.params), 'layers=foo&styles=&service=WMS&request=GetMap&version=1.3.0')
def test_str(self): query_eq(str(self.r.params), 'layers=foo&styles=&service=WMS&request=GetMap&version=1.3.0')