示例#1
0
    def test_allNew(self):
        local = [self.file1, self.file2, self.file3, self.file4]
        remote = []
        new, mod, unmod, delt = deploy.compareFiles(local, remote)
        self.assertEqual(len(new), 4)
        self.assertEqual(len(mod), 0)
        self.assertEqual(len(unmod), 0)
        self.assertEqual(len(delt), 0)

        self.assertTrue("polo" in new)
        self.assertTrue("golf" in new)
        self.assertTrue("mileslog" in new)
        self.assertTrue("sales" in new)
示例#2
0
    def test_someDeleted(self):
        local = [self.file1, self.file2, self.file3_1]
        remote = [self.file1, self.file2, self.file3, self.file4]
        new, mod, unmod, delt = deploy.compareFiles(local, remote)
        self.assertEqual(len(new), 0)
        self.assertEqual(len(mod), 1)
        self.assertEqual(len(unmod), 2)
        self.assertEqual(len(delt), 1)

        self.assertTrue("mileslog" in mod)
        self.assertTrue("polo" in unmod)
        self.assertTrue("golf" in unmod)
        self.assertTrue("sales" in delt)
示例#3
0
    def test_ignoreDelete(self):
        # First Test with remoteDelete = True
        local = [self.file1]
        remote = [self.file1, self.file2, deploy.File("/.ftpquota")]
        new, modified, unmodified, deleted = deploy.compareFiles(local, remote, True)

        self.assertEqual(len(new), 0)
        self.assertEqual(len(modified), 0)
        self.assertEqual(len(unmodified), 1)
        self.assertEqual(len(deleted), 1)
        self.assertTrue("polo" in unmodified)
        self.assertTrue("golf" in deleted)

        # Second Test with remoteDelete = False
        local = [self.file1]
        remote = [self.file1, self.file2, deploy.File("/.ftpquota")]
        new, modified, unmodified, deleted = deploy.compareFiles(local, remote, False)

        self.assertEqual(len(new), 0)
        self.assertEqual(len(modified), 0)
        self.assertEqual(len(unmodified), 1)
        self.assertEqual(len(deleted), 0)
        self.assertTrue("polo" in unmodified)
示例#4
0
 def test_allEmpty(self):
     new, mod, unmod, delt = deploy.compareFiles([], [])
     self.assertEqual(len(new), 0)
     self.assertEqual(len(mod), 0)
     self.assertEqual(len(unmod), 0)
     self.assertEqual(len(delt), 0)