Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_tiled_source.py   mapproxy(Download)
        with mock_httpd(TEST_SERVER_ADDRESS, [({'path': '/1/0/0.png'},
                                                {'body': 'error', 'status': 500, 'headers':{'content-type': 'text/plain'}})]):
            resp = self.source.get_map(MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format='png'))
            assert resp.cacheable 
            eq_(resp.as_image().getcolors(), [((256*256), (255, 0, 0))])
        with mock_httpd(TEST_SERVER_ADDRESS, [({'path': '/1/0/0.png'},
                                                {'body': 'error', 'status': 500, 'headers':{'content-type': 'text/plain'}})]):
            resp = self.source.get_map(MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format='png'))
            assert not resp.cacheable 
            eq_(resp.as_image().getcolors(), [((256*256), (255, 0, 0))])
            ({'path': '/1/0/0.png'}, {'body': 'error', 'status': 204, 'headers':{'content-type': 'text/plain'}})]):
 
            resp = self.source.get_map(MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format='png'))
            assert not resp.cacheable 
            eq_(resp.as_image().getcolors(), [((256*256), (255, 0, 0))])
 
            resp = self.source.get_map(MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format='png'))

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_tiled_source.py   MapProxy(Download)
        with mock_httpd(TEST_SERVER_ADDRESS, [({'path': '/1/0/0.png'},
                                                {'body': 'error', 'status': 500, 'headers':{'content-type': 'text/plain'}})]):
            resp = self.source.get_map(MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format='png'))
            assert resp.cacheable 
            eq_(resp.as_image().getcolors(), [((256*256), (255, 0, 0))])
        with mock_httpd(TEST_SERVER_ADDRESS, [({'path': '/1/0/0.png'},
                                                {'body': 'error', 'status': 500, 'headers':{'content-type': 'text/plain'}})]):
            resp = self.source.get_map(MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format='png'))
            assert not resp.cacheable 
            eq_(resp.as_image().getcolors(), [((256*256), (255, 0, 0))])
            ({'path': '/1/0/0.png'}, {'body': 'error', 'status': 204, 'headers':{'content-type': 'text/plain'}})]):
 
            resp = self.source.get_map(MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format='png'))
            assert not resp.cacheable 
            eq_(resp.as_image().getcolors(), [((256*256), (255, 0, 0))])
 
            resp = self.source.get_map(MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format='png'))