Ejemplo n.º 1
0
    def test_writes_file(self):
        contents = "foo" + str(randint(0, 100))
        sw = StringWriter(contents)
        filename = './stuff.txt'
        sw.write_received_file(filename)

        with open(filename, 'r') as received:
            self.assertEqual(contents, received.read())

        os.remove(filename)
 def test_compare_same_files():
     approver = FileApprover()
     writer = StringWriter("a")
     writer.write_received_file("a.txt")
     shutil.copy("a.txt", "a_same.txt")
     approver.verify_files("a.txt", "a_same.txt", None)
Ejemplo n.º 3
0
 def test_compare_same_files():
     approver = FileApprover()
     writer = StringWriter("a")
     writer.write_received_file("a.txt")
     shutil.copy("a.txt", "a_same.txt")
     approver.verify_files("a.txt", "a_same.txt", None)