def test_isFileModifiedOrNew_fileHasNoChanges(self): previousFile = join(self._backupHome, "oldFile") newFile = join(self._backupHome, "newFile") self._touch(previousFile) self._touch(newFile) self.assertFalse(backup.isFileModifiedOrNew(previousFile, newFile)) os.remove(previousFile) os.remove(newFile)
def test_isFileModifiedOrNew_fileIsModified(self): previousFile = join(self._backupHome, "oldFile") newFile = join(self._backupHome, "newFile") self._touch(previousFile) self._touch(newFile) os.utime(previousFile, (1340664089, 1320861443)) self.assertTrue(backup.isFileModifiedOrNew(previousFile, newFile)) os.remove(previousFile) os.remove(newFile)
def test_isFileModifiedOrNew_fileIsNew(self): newFile = join(self._backupHome, "newFile") self._touch(newFile) self.assertTrue(backup.isFileModifiedOrNew("Blah", newFile)) os.remove(newFile)