예제 #1
0
def _(tmp=temp_config_plugins):
    conf = read_config_toml(Path(tempfile.gettempdir()), tmp.name)
    assert conf == {
        "built_in_config": "some-value",
        "plugins": {
            "apples": {"num_apples": 3},
            "bananas": {"num_bananas": 4},
        },
    }
예제 #2
0
파일: test_config.py 프로젝트: AABur/ward
def _(tmp=temp_config_missing):
    conf = read_config_toml(Path(tempfile.gettempdir()), tmp.name)
    assert conf == {}
예제 #3
0
파일: test_config.py 프로젝트: AABur/ward
def _():
    conf = read_config_toml(Path(tempfile.gettempdir()), "doesnt_exist.toml")
    assert conf == {}
예제 #4
0
파일: test_config.py 프로젝트: AABur/ward
def _(tmp=temp_config_file):
    conf = read_config_toml(Path(tempfile.gettempdir()), tmp.name)
    assert "path" in conf
    assert conf["path"] == "test_path"
예제 #5
0
파일: test_config.py 프로젝트: AABur/ward
def _(tmp=temp_config_invalid):
    with raises(click.FileError):
        read_config_toml(Path(tempfile.gettempdir()), tmp.name)
예제 #6
0
파일: test_config.py 프로젝트: AABur/ward
def _(tmp=temp_config_file_hyphens):
    conf = read_config_toml(Path(tempfile.gettempdir()), tmp.name)
    assert "some_key" in conf
    assert conf["some_key"] == "some-value"