def test_base_request(self): req = ArcGISIdentifyRequest(url="http://example.com/ArcGIS/rest/MapServer/") eq_("http://example.com/ArcGIS/rest/MapServer/identify", req.url) req.params.bbox = [-180.0, -90.0, 180.0, 90.0] eq_((-180.0, -90.0, 180.0, 90.0), req.params.bbox) eq_("-180.0,-90.0,180.0,90.0", req.params["mapExtent"]) req.params.size = [256, 256] eq_((256, 256), req.params.size) eq_("256,256,96", req.params["imageDisplay"]) req.params.srs = "EPSG:4326" eq_("EPSG:4326", req.params.srs) eq_("4326", req.params["sr"])
def test_base_request(self): req = ArcGISIdentifyRequest( url="http://example.com/ArcGIS/rest/MapServer/") assert "http://example.com/ArcGIS/rest/MapServer/identify" == req.url req.params.bbox = [-180.0, -90.0, 180.0, 90.0] assert (-180.0, -90.0, 180.0, 90.0) == req.params.bbox assert "-180.0,-90.0,180.0,90.0" == req.params["mapExtent"] req.params.size = [256, 256] assert (256, 256) == req.params.size assert "256,256,96" == req.params["imageDisplay"] req.params.srs = "EPSG:4326" assert "EPSG:4326" == req.params.srs assert "4326" == req.params["sr"]
def test_transform_fi_request_supported_srs(self): req = ArcGISIdentifyRequest(url=TESTSERVER_URL + '/MapServer/export?map=foo', param={'layers':'foo'}) http = MockHTTPClient() wms = ArcGISInfoClient(req, http_client=http, supported_srs=[SRS(25832)]) fi_req = InfoQuery((8, 50, 9, 51), (512, 512), SRS(4326), (128, 64), 'text/plain') wms.get_info(fi_req) assert_query_eq(http.requested[0], TESTSERVER_URL+'/MapServer/identify?map=foo' '&imageDisplay=512,797,96&sr=25832&f=json' '&layers=foo&tolerance=5&returnGeometry=false' '&geometryType=esriGeometryPoint&geometry=447229.979084,5636149.370634' '&mapExtent=428333.552496,5538630.70275,500000.0,5650300.78652', fuzzy_number_compare=True)
def test_fi_request(self): req = ArcGISIdentifyRequest(url=TESTSERVER_URL + '/MapServer/export?map=foo', param={'layers':'foo'}) http = MockHTTPClient() wms = ArcGISInfoClient(req, http_client=http, supported_srs=[SRS(4326)]) fi_req = InfoQuery((8, 50, 9, 51), (512, 512), SRS(4326), (128, 64), 'text/plain') wms.get_info(fi_req) assert_query_eq(http.requested[0], TESTSERVER_URL+'/MapServer/identify?map=foo' '&imageDisplay=512,512,96&sr=4326&f=json' '&layers=foo&tolerance=5&returnGeometry=false' '&geometryType=esriGeometryPoint&geometry=8.250000,50.875000' '&mapExtent=8,50,9,51', fuzzy_number_compare=True)
def test_endpoint_urls(self, url, expected): req = ArcGISIdentifyRequest(url=url) assert req.url == expected
def check_endpoint(self, url, expected): req = ArcGISIdentifyRequest(url=url) eq_(req.url, expected)