Esempio n. 1
0
 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"]
         )
Esempio n. 2
0
def _load_config_memcache():
    return config.load_config()
Esempio n. 3
0
 def test_complete_dataset(self, patch_config):
     conf = config.load_config()
     assert "datasets" in conf
     assert len(conf["datasets"]) == 6
Esempio n. 4
0
 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()
Esempio n. 5
0
 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()