Beispiel #1
0
 def testIsBackupNewer(self):
     """Test checking that the backup is newer"""
     fname = common.MakeTempFile("test2.txt")
     fobj = ebmlib.FileObjectImpl(fname)
     self.assertFalse(self.bkup.IsBackupNewer(fname))
     time.sleep(1)  # make sure modtime is different
     writer = self.bkup.GetBackupWriter(fobj)
     writer("TEST BACKUP")
     bname = self.bkup.GetBackupFilename(fname)
     self.assertTrue(self.bkup.IsBackupNewer(fname))
Beispiel #2
0
 def setUp(self):
     self.path = common.GetDataFilePath(u'test_read_utf8.txt')
     self.file = ebmlib.FileObjectImpl(self.path)
     self.mtime = ebmlib.GetFileModTime(self.path)
Beispiel #3
0
 def setUp(self):
     self.bkup = ebmlib.FileBackupMgr(None, u"%s~")
     self.path = common.MakeTempFile("test.txt")
     self.file = ebmlib.FileObjectImpl(self.path)
Beispiel #4
0
 def testExists(self):
     """Test if the file exists"""
     self.assertTrue(self.file.Exists())
     nfile = ebmlib.FileObjectImpl('some_fake_file')
     self.assertFalse(nfile.Exists())