Пример #1
0
 def test_basic_get_runnable_checks(self):
     not_ran = Check(
         job_id = self.job.id,
         url = 'http://www.foo.com',
         browser_name = 'firefox',
         version = '15',
         platform = 'ANY',
         try_count = 0,
     )
     db.session.add(not_ran)
     db.session.commit()
     self.assertEqual([self.not_ran, not_ran], list(Check.get_runnable_checks()))
Пример #2
0
 def test_get_runnable_checks_lock(self):
     self.assertEqual([self.not_ran], list(Check.get_runnable_checks(mark_running=True)))
     self.assertEqual([], list(Check.get_runnable_checks(mark_running=True)))
     self.assertTrue(self.not_ran.running)
     self.assertEqual(1, self.not_ran.try_count)
     self.assertIsInstance(self.not_ran.last_run, datetime)