Exemplo n.º 1
0
def test_validate_astropy_quantities():
    config = AnalysisConfig()
    cfg = {
        "observations": {
            "filters": [{
                "filter_type": "all",
                "lon": "1 deg"
            }]
        }
    }
    config.update_settings(cfg)
    assert config.validate() is None
Exemplo n.º 2
0
def test_config():
    config = AnalysisConfig()
    assert config.settings["general"]["logging"]["level"] == "INFO"
    cfg = {"general": {"outdir": "test"}}
    config.update_settings(cfg)
    assert config.settings["general"]["logging"]["level"] == "INFO"
    assert config.settings["general"]["outdir"] == "test"

    with pytest.raises(ValueError):
        Analysis()

    assert "AnalysisConfig" in str(config)