def test_cfg2(): p = docstring_to_file(DOC_SPEC, "test_spec.txt") header_dict, unit_dict = load_spec(p) assert header_dict == {"Инвестиции в основной капитал": ["I", "bln_rub"]} assert unit_dict == {"в % к предыдущему периоду": "rog"} if MUST_CLEANUP: delete_file(p)
def test_io(doc = DOC_1): p = docstring_to_file(doc, "test_yaml_doc.txt") assert doc == "\n".join([x[0] for x in yield_csv_rows(p)]) y = get_yaml(p) assert y[0][0] == 'Something looking like a yaml' assert y[1]["key1"] == 'with two documents' delete_file(p)
def test_io(doc=DOC_1): p = docstring_to_file(doc, "test_yaml_doc.txt") assert doc == "\n".join([x[0] for x in yield_csv_rows(p)]) y = get_yaml(p) assert y[0][0] == 'Something looking like a yaml' assert y[1]["key1"] == 'with two documents' delete_file(p)
def test_cfg2(): p = docstring_to_file(DOC_SPEC, "test_spec.txt") header_dict, unit_dict = load_spec(p) assert header_dict == {"Инвестиции в основной капитал" : ["I", "bln_rub"]} assert unit_dict == {"в % к предыдущему периоду" : "rog"} if MUST_CLEANUP: delete_file(p)
def test_with_file(): filename = "_test_yaml_spec_sample.txt" p = docstring_to_file(yaml_doc, filename) d1, d2 = load_spec(p) assert d1 == header_dict assert d2 == unit_dict delete_file(p)
def test_cfg1(): p = docstring_to_file(CFG_SPEC, "test_cfg.txt") cfgs = load_cfg(p) print(cfgs) #assert cfgs[0][0] == "3.5. Индекс потребительских цен" #assert cfgs[1][2] == "_spec_1.txt" if MUST_CLEANUP: delete_file(p)
def test_cfg1(): p = docstring_to_file(CFG_SPEC, "test_cfg.txt") cfgs = load_cfg(p) print (cfgs) #assert cfgs[0][0] == "3.5. Индекс потребительских цен" #assert cfgs[1][2] == "_spec_1.txt" if MUST_CLEANUP: delete_file(p)