def test_defaults_get_overridden(self): path = "tests/data/configs/non-default-values.yaml" with patch("opentopodata.config.CONFIG_PATH", path): conf = config.load_config() assert ( conf["max_locations_per_request"] != config.DEFAULTS["max_locations_per_request"] ) assert ( conf["access_control_allow_origin"] != config.DEFAULTS["access_control_allow_origin"] )
def _load_config_memcache(): return config.load_config()
def test_complete_dataset(self, patch_config): conf = config.load_config() assert "datasets" in conf assert len(conf["datasets"]) == 6
def test_nopath_dataset(self): path = "tests/data/configs/no-path-dataset.yaml" with pytest.raises(config.ConfigError): with patch("opentopodata.config.CONFIG_PATH", path): config.load_config()
def test_missing_file(self): with pytest.raises(config.ConfigError): with patch("opentopodata.config.CONFIG_PATH", MISSING_CONFIG_PATH): with patch("opentopodata.config.EXAMPLE_CONFIG_PATH", MISSING_CONFIG_PATH): config.load_config()