Ejemplo n.º 1
0
 def test_exception_if_already_running(self):
     code_import = self.factory.makeCodeImport(
         git_repo_url=self.factory.getUniqueURL())
     code_import = make_running_import(factory=self.factory,
         code_import=code_import)
     requester = self.factory.makePerson()
     self.assertRaises(
         CodeImportAlreadyRunning, code_import.requestImport,
         requester)
 def makeJobWithHeartbeatInPast(self, seconds_in_past):
     code_import = make_running_import(factory=self.factory)
     naked_job = removeSecurityProxy(code_import.import_job)
     naked_job.heartbeat = UTC_NOW + u'%d seconds' % -seconds_in_past
     return code_import.import_job