def test_get_mapproxy_footprint_url(self): example_slug = "test" url = "http://test.test" with self.settings(SITE_URL=url): expected_value = ( f"{url}/map/{example_slug}/wmts/{get_footprint_layer_name(example_slug)}/default/" f"{{z}}/{{x}}/{{y}}.png") returned_value = get_mapproxy_footprint_url(example_slug) self.assertEqual(expected_value, returned_value)
def footprint_url(self): from eventkit_cloud.utils.mapproxy import get_mapproxy_footprint_url if not self.config: return None config = yaml.load(self.config) url = config.get("sources", {}).get("footprint", {}).get("req", {}).get("url") if url: return get_mapproxy_footprint_url(self.slug)