def test_property_table_from_json(): tmp_dir = scratch_path / "property_table_from_json" tmp_dir.mkdir() prop_path = tmp_dir / "prop.json" for gj in good_table_json: json.dump(gj, prop_path.open("w")) tbl = PropertyTable.load(prop_path.open()) assert tbl.data.num_columns == 2
def test_property_table_from_json(): with TempDir() as d: filename = os.path.join(d, "prop.json") for gj in good_table_json: fp = open(filename, "w") json.dump(gj, fp) fp.close() fp = open(filename, "r") tbl = PropertyTable.load(fp) assert tbl.data.num_columns == 2 os.unlink(filename)