def testTouchTimeStamp(self): "Verify that the time stamp file gets touched" import time import os ct = time.time() # heh, lame but only have one sec resolution on file stamps time.sleep(1) up2dateUtils.touchTimeStamp() timestamp = os.stat(up2dateUtils.LAST_UPDATE_FILE)[8] if ct >= timestamp: self.fail("Timestamp not updated")
def testNoTimeStampFile(self): "Verify that touchTimeStamp handles no timestamp file existing" import os os.unlink(up2dateUtils.LAST_UPDATE_FILE) res = up2dateUtils.touchTimeStamp() if not os.access(up2dateUtils.LAST_UPDATE_FILE, os.R_OK): self.fail("No timestamp file created")