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
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