import pickle from Jt import Coordinate import os def test_save_and_load(): coord_list = os.listdir("coord") if "testCoord.crd" in coord_list: print("Removing existing test file...") os.remove("coord/testCoord.crd") c = Coordinate() c.name = "testCoord1" c.save_coord() with open("coord/" + c.name + ".crd", "rb") as f: cc = pickle.load(f) # os.remove("coord/testCoord.crd") assert cc.name == "testCoord1"