Esempio n. 1
0
def test_multiview(tmpdir, capsys):
    test_file = tmpdir.join('test.conf')
    conf = JSONConfigParser(storage=test_file.strpath)
    conf["packages"] = ["jsonconfigparser", "ply", "decorator"]

    conf.view("$.packages.[*]")

    captured, _ = capsys.readouterr()

    assert "packages.[1]" in captured
    assert "ply" in captured
Esempio n. 2
0
def test_view(tmpdir, capsys):
    test_file = tmpdir.join('test.conf')
    conf = JSONConfigParser(storage=test_file.strpath)
    conf['test'] = "Yes"
    conf.view('$')

    captured, _ = capsys.readouterr()

    assert "$" in captured
    assert "'test'" in captured
    assert "'Yes'" in captured