def tile_request(self, tile, auth): env = make_wsgi_env('', extra_environ={ 'mapproxy.authorize': auth, 'PATH_INFO': '/tiles/' + tile }) req = Request(env) return tile_request(req)
def test_tms_request(self): env = {"PATH_INFO": "/tms/1.0.0/osm/5/2/3.png", "QUERY_STRING": ""} req = Request(env) tms = tile_request(req) assert isinstance(tms, TMSRequest) assert tms.tile == (2, 3, 5) assert tms.format == "png" assert tms.layer == "osm" assert tms.dimensions == {}
def test_tile_request_w_epsg(self): env = {"PATH_INFO": "/tiles/1.0.0/osm/EPSG4326/5/2/3.png", "QUERY_STRING": ""} req = Request(env) tile_req = tile_request(req) assert isinstance(tile_req, TileRequest) eq_(tile_req.tile, (2, 3, 5)) eq_(tile_req.format, "png") eq_(tile_req.layer, "osm") eq_(tile_req.dimensions, {"_layer_spec": "EPSG4326"})
def test_tms_request(self): env = {"PATH_INFO": "/tms/1.0.0/osm/5/2/3.png", "QUERY_STRING": ""} req = Request(env) tms = tile_request(req) assert isinstance(tms, TMSRequest) eq_(tms.tile, (2, 3, 5)) eq_(tms.format, "png") eq_(tms.layer, "osm") eq_(tms.dimensions, {})
def test_tile_request(self): env = {"PATH_INFO": "/tiles/1.0.0/osm/5/2/3.png", "QUERY_STRING": ""} req = Request(env) tile_req = tile_request(req) assert isinstance(tile_req, TileRequest) assert tile_req.tile == (2, 3, 5) assert tile_req.origin == None assert tile_req.format == "png" assert tile_req.layer == "osm" assert tile_req.dimensions == {}
def test_tile_request_flipped_y(self): env = {"PATH_INFO": "/tiles/1.0.0/osm/5/2/3.png", "QUERY_STRING": "origin=nw"} req = Request(env) tile_req = tile_request(req) assert isinstance(tile_req, TileRequest) eq_(tile_req.tile, (2, 3, 5)) # not jet flipped eq_(tile_req.origin, "nw") eq_(tile_req.format, "png") eq_(tile_req.layer, "osm") eq_(tile_req.dimensions, {})
def test_tile_request_w_epsg(self): env = { 'PATH_INFO': '/tiles/1.0.0/osm/EPSG4326/5/2/3.png', 'QUERY_STRING': '', } req = Request(env) tile_req = tile_request(req) assert isinstance(tile_req, TileRequest) eq_(tile_req.tile, (2, 3, 5)) eq_(tile_req.format, 'png') eq_(tile_req.layer, 'osm') eq_(tile_req.dimensions, {'_layer_spec': 'EPSG4326'})
def test_tms_request(self): env = { 'PATH_INFO': '/tms/1.0.0/osm/5/2/3.png', 'QUERY_STRING': '', } req = Request(env) tms = tile_request(req) assert isinstance(tms, TMSRequest) eq_(tms.tile, (2, 3, 5)) eq_(tms.format, 'png') eq_(tms.layer, 'osm') eq_(tms.dimensions, {})
def test_tile_request_w_epsg(self): env = { "PATH_INFO": "/tiles/1.0.0/osm/EPSG4326/5/2/3.png", "QUERY_STRING": "" } req = Request(env) tile_req = tile_request(req) assert isinstance(tile_req, TileRequest) assert tile_req.tile == (2, 3, 5) assert tile_req.format == "png" assert tile_req.layer == "osm" assert tile_req.dimensions == {"_layer_spec": "EPSG4326"}
def test_tile_request_flipped_y(self): env = { 'PATH_INFO': '/tiles/1.0.0/osm/5/2/3.png', 'QUERY_STRING': 'origin=nw', } req = Request(env) tile_req = tile_request(req) assert isinstance(tile_req, TileRequest) eq_(tile_req.tile, (2, 3, 5)) # not jet flipped eq_(tile_req.origin, 'nw') eq_(tile_req.format, 'png') eq_(tile_req.layer, 'osm') eq_(tile_req.dimensions, {})
def test_tile_request(self): env = { 'PATH_INFO': '/tiles/1.0.0/osm/5/2/3.png', 'QUERY_STRING': '', } req = Request(env) tile_req = tile_request(req) assert isinstance(tile_req, TileRequest) eq_(tile_req.tile, (2, 3, 5)) eq_(tile_req.origin, None) eq_(tile_req.format, 'png') eq_(tile_req.layer, 'osm') eq_(tile_req.dimensions, tuple())
def tile_request(self, tile, auth): env = make_wsgi_env('', extra_environ={'mapproxy.authorize': auth, 'PATH_INFO': '/tiles/'+tile}) req = Request(env) return tile_request(req)