def test_cmp_copy(self): #Function cmp_copy shex.mkdir("testdirec") shex.cmp_copy("testfile", "testdirec/testfilecopy") fh1 = open("testdirec/testfilecopy", "r") fh2 = open("testfile", "r") assert(fh1.readlines()==fh2.readlines()) fh1.close() fh2.close() os.remove("testdirec/testfilecopy") os.rmdir("testdirec")
def bad_cmp_copy(self): fh = open("filex", "w") fh.close() list = os.listdir(".") shex.cmp_copy("testfile", "filex") os.remove("filex")