def test_statFile_exists(self): rp = self.makeRP() open('statfile.log', 'w').write('hi') lf = runprocess.LogFileWatcher(rp, 'test', 'statfile.log', False) st = lf.statFile() self.assertEqual(st and st[2], 2, "statfile.log exists and size is correct") os.remove('statfile.log')
def test_statFile_missing(self): rp = self.makeRP() if os.path.exists('statfile.log'): os.remove('statfile.log') lf = runprocess.LogFileWatcher(rp, 'test', 'statfile.log', False) self.assertFalse(lf.statFile(), "statfile.log doesn't exist")