def test_send_removed_revision_emails_subscribed(self): """send_removed_revision_emails run when RevisionsRemoved emitted.""" self.useBzrBranches(direct_database=True) db_branch, tree = self.create_branch_and_tree() db_branch.subscribe(db_branch.registrant, BranchSubscriptionNotificationLevel.FULL, BranchSubscriptionDiffSize.WHOLEDIFF, CodeReviewNotificationLevel.FULL, db_branch.registrant) self.assertEqual(0, len(list(RevisionMailJob.iterReady()))) notify(events.RevisionsRemoved(db_branch, tree.branch, ['x'])) self.assertEqual(1, len(list(RevisionMailJob.iterReady())))
def test_queue_tip_changed_email_jobs_subscribed(self): """A queue_tip_changed_email_jobs is run when TipChanged emitted.""" self.useBzrBranches(direct_database=True) db_branch, tree = self.create_branch_and_tree() db_branch.subscribe(db_branch.registrant, BranchSubscriptionNotificationLevel.FULL, BranchSubscriptionDiffSize.WHOLEDIFF, CodeReviewNotificationLevel.FULL, db_branch.registrant) self.assertEqual(0, len(list(RevisionMailJob.iterReady()))) notify(events.TipChanged(db_branch, tree.branch, True)) self.assertEqual(1, len(list(RevisionMailJob.iterReady())))
def test_send_removed_revision_emails_subscribed(self): """send_removed_revision_emails run when RevisionsRemoved emitted.""" self.useBzrBranches(direct_database=True) db_branch, tree = self.create_branch_and_tree() db_branch.subscribe( db_branch.registrant, BranchSubscriptionNotificationLevel.FULL, BranchSubscriptionDiffSize.WHOLEDIFF, CodeReviewNotificationLevel.FULL, db_branch.registrant) self.assertEqual(0, len(list(RevisionMailJob.iterReady()))) notify(events.RevisionsRemoved(db_branch, tree.branch, ['x'])) self.assertEqual(1, len(list(RevisionMailJob.iterReady())))
def test_queue_tip_changed_email_jobs_subscribed(self): """A queue_tip_changed_email_jobs is run when TipChanged emitted.""" self.useBzrBranches(direct_database=True) db_branch, tree = self.create_branch_and_tree() db_branch.subscribe( db_branch.registrant, BranchSubscriptionNotificationLevel.FULL, BranchSubscriptionDiffSize.WHOLEDIFF, CodeReviewNotificationLevel.FULL, db_branch.registrant) self.assertEqual(0, len(list(RevisionMailJob.iterReady()))) notify(events.TipChanged(db_branch, tree.branch, True)) self.assertEqual(1, len(list(RevisionMailJob.iterReady())))