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)
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)
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)
def test_allEmpty(self): new, existing, deleted = deploy.compareDirs([], []) self.assertEqual(len(new), 0) self.assertEqual(len(existing), 0) self.assertEqual(len(deleted), 0)