def test_02_cronlog(self):
     """Cron Log Items"""
     entries = list(CronLog(os.path.join(TEST_DIR, 'data', 'test.log')))
     self.assertEqual(len(entries), 19)
     self.assertEqual(entries[0]['pid'], "16592")
     self.assertEqual(entries[3]['pid'], "16574")
     self.assertEqual(entries[-1]['pid'], "16490")
Esempio n. 2
0
    def log(self):
        """Returns the CronLog object for this tab (user or root tab only)"""
        from cronlog import CronLog

        if self._log is None or isinstance(self._log, basestring):
            self._log = CronLog(self._log, user=self.user or "root")
        return self._log
Esempio n. 3
0
 def test_02_cronlog(self):
     """Cron Log Items"""
     entries = list(CronLog('data/test.log'))
     self.assertEqual(len(entries), 19)
     self.assertEqual(entries[0]['pid'], "16592")
     self.assertEqual(entries[3]['pid'], "16574")
     self.assertEqual(entries[-1]['pid'], "16490")
Esempio n. 4
0
 def log(self):
     from cronlog import CronLog
     if self._log == None or isinstance(self._log, basestring):
         self._log = CronLog(self._log, user=self.user or 'root')
     return self._log
Esempio n. 5
0
 def log(self):
     """Returns the CronLog object for this tab (user or root tab only)"""
     from cronlog import CronLog  # pylint: disable=import-outside-toplevel
     if self._log is None or isinstance(self._log, basestring):
         self._log = CronLog(self._log, user=self.user or 'root')
     return self._log