Example #1
0
 def test_resubmit_resubmitted(self):
     job = TestJob.objects.create(backend=self.backend,
                                  target=self.project,
                                  job_id='22.1')
     impl = FakeBackend(self.backend)
     new_job = impl.resubmit(job)
     self.assertEqual('22.1.1', new_job.job_id)
Example #2
0
 def test_fetch(self):
     job = TestJob.objects.create(backend=self.backend, target=self.project)
     impl = FakeBackend(self.backend)
     (status, completed, metadata, tests, metrics, logs) = impl.fetch(job)
     self.assertIsInstance(status, str)
     self.assertIsInstance(completed, bool)
     self.assertIsInstance(metadata, dict)
     self.assertIsInstance(tests, dict)
     self.assertIsInstance(metrics, dict)
     self.assertIsInstance(logs, str)
Example #3
0
 def test_resubmit(self):
     job = TestJob.objects.create(backend=self.backend,
                                  target=self.project,
                                  job_id='22')
     impl = FakeBackend(self.backend)
     new_job = impl.resubmit(job)
     self.assertIsInstance(new_job, TestJob)
     self.assertIsNot(job, new_job)
     self.assertEqual('22.1', new_job.job_id)
     self.assertEqual(job, new_job.parent_job)
Example #4
0
 def test_job_url(self):
     job = TestJob(job_id='123')
     impl = FakeBackend(self.backend)
     self.assertIsInstance(impl.job_url(job), str)
Example #5
0
 def test_submit(self):
     job = TestJob.objects.create(backend=self.backend, target=self.project)
     impl = FakeBackend(self.backend)
     jid = impl.submit(job)
     self.assertEqual(str(job.id), jid)