Exemplo n.º 1
0
 def test_CodeReviewCommentEmailJob(self):
     """CodeReviewCommentEmailJob runs under Celery."""
     comment = self.factory.makeCodeReviewComment()
     self.useFixture(FeatureFixture(
         {'jobs.celery.enabled_classes': 'CodeReviewCommentEmailJob'}))
     with block_on_job():
         CodeReviewCommentEmailJob.create(comment)
         transaction.commit()
     self.assertEqual(2, len(pop_remote_notifications()))
Exemplo n.º 2
0
 def test_get_with_merge_proposal_job(self):
     """Getting a MergeProposalJob works and is efficient."""
     comment = self.factory.makeCodeReviewComment()
     job = CodeReviewCommentEmailJob.create(comment)
     job_id = job.job_id
     transaction.commit()
     with StormStatementRecorder() as recorder:
         got_job = UniversalJobSource.get(
             (job_id, 'lp.code.model.branchmergeproposaljob',
              'BranchMergeProposalJob'))
     self.assertThat(recorder, HasQueryCount(Equals(1)))
     self.assertEqual(got_job, job)
Exemplo n.º 3
0
 def test_getOperationDescription(self):
     comment = self.factory.makeCodeReviewComment()
     job = CodeReviewCommentEmailJob.create(comment)
     self.assertEqual(
         'emailing a code review comment',
         job.getOperationDescription())
Exemplo n.º 4
0
 def test_providesInterface(self):
     """CodeReviewCommentEmailJob provides the expected interfaces."""
     comment = self.factory.makeCodeReviewComment()
     job = CodeReviewCommentEmailJob.create(comment)
     verifyObject(ICodeReviewCommentEmailJob, job)
     verifyObject(IBranchMergeProposalJob, job)