예제 #1
0
    def test_ignoreDelete(self):
        local = [self.dir1]
        remote = [self.dir1, self.dir2, deploy.Directory("/cgi-bin")]
        new, existing, deleted = deploy.compareDirs(local, remote, True)

        self.assertEqual(len(new), 0)
        self.assertEqual(len(existing), 1)
        self.assertEqual(len(deleted), 1)

        self.assertTrue("vw" in existing)
        self.assertTrue("bmw" in deleted)

        local = [self.dir1]
        remote = [self.dir1, self.dir2, deploy.Directory("/cgi-bin")]
        new, existing, deleted = deploy.compareDirs(local, remote, False)

        self.assertEqual(len(new), 0)
        self.assertEqual(len(existing), 1)
        self.assertEqual(len(deleted), 0)

        self.assertTrue("vw" in existing)
예제 #2
0
    def test_allNew(self):
        local = [self.dir1, self.dir2, self.dir3, self.dir4]
        remote = []
        new, existing, deleted = deploy.compareDirs(local, remote)
        self.assertEqual(len(new), 4)
        self.assertEqual(len(existing), 0)
        self.assertEqual(len(deleted), 0)

        self.assertTrue("vw" in new)
        self.assertTrue("bmw" in new)
        self.assertTrue("ford" in new)
        self.assertTrue("renolt" in new)
예제 #3
0
    def test_someDeleted(self):
        local = [self.dir1, self.dir3]
        remote = [self.dir1, self.dir2, self.dir3, self.dir4]
        new, existing, deleted = deploy.compareDirs(local, remote)
        self.assertEqual(len(new), 0)
        self.assertEqual(len(existing), 2)
        self.assertEqual(len(deleted), 2)

        self.assertTrue("vw" in existing)
        self.assertTrue("ford" in existing)
        self.assertTrue("bmw" in deleted)
        self.assertTrue("renolt" in deleted)
예제 #4
0
 def test_allEmpty(self):
     new, existing, deleted = deploy.compareDirs([], [])
     self.assertEqual(len(new), 0)
     self.assertEqual(len(existing), 0)
     self.assertEqual(len(deleted), 0)