示例#1
0
def test_json(tmpdir):
    conf = tmpdir.join("conf.json")
    conf.write('{"a": "b", "c": 3}')
    assert _load_config(str(conf)) == {"a": "b", "c": 3}
示例#2
0
def test_load_empty_yaml(tmpdir):
    pytest.importorskip("ruamel.yaml")
    conf = tmpdir.join("conf.yaml")
    conf.write("")
    assert _load_config(str(conf)) == {}
示例#3
0
def test_json(tmpdir):
    conf = tmpdir.join('conf.json')
    conf.write('{"a": "b", "c": 3}')
    assert _load_config(str(conf)) == {'a': 'b', 'c': 3}
示例#4
0
def test_yaml(tmpdir):
    pytest.importorskip("ruamel.yaml")
    conf = tmpdir.join("conf.yaml")
    conf.write("a: b\nc: 3")
    assert _load_config(str(conf)) == {"a": "b", "c": 3}
示例#5
0
def test_yaml(tmpdir):
    pytest.importorskip('ruamel.yaml')
    conf = tmpdir.join('conf.yaml')
    conf.write('a: b\nc: 3')
    assert _load_config(str(conf)) == {'a': 'b', 'c': 3}