~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/model/tests/test_branchjob.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-10-07 00:07:41 UTC
  • mfrom: (14100.2.7 longpoll-jobs)
  • Revision ID: launchpad@pqm.canonical.com-20111007000741-u46lg5rktq2lcviu
[r=allenap][no-qa] Misc jobs-related interface clean-ups.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    get_newest_librarian_file,
37
37
    )
38
38
from canonical.launchpad.webapp import canonical_url
39
 
from canonical.launchpad.webapp.testing import verifyObject
40
39
from canonical.testing.layers import (
41
40
    DatabaseFunctionalLayer,
42
41
    LaunchpadZopelessLayer,
99
98
    def test_providesInterface(self):
100
99
        """Ensure that BranchJob implements IBranchJob."""
101
100
        branch = self.factory.makeAnyBranch()
102
 
        verifyObject(
103
 
            IBranchJob, BranchJob(branch, BranchJobType.STATIC_DIFF, {}))
 
101
        self.assertProvides(
 
102
            BranchJob(branch, BranchJobType.STATIC_DIFF, {}),
 
103
            IBranchJob)
104
104
 
105
105
    def test_destroySelf_destroys_job(self):
106
106
        """Ensure that BranchJob.destroySelf destroys the Job as well."""
132
132
        """Ensure that BranchScanJob implements IBranchScanJob."""
133
133
        branch = self.factory.makeAnyBranch()
134
134
        job = BranchScanJob.create(branch)
135
 
        verifyObject(IBranchScanJob, job)
 
135
        self.assertProvides(job, IBranchScanJob)
136
136
 
137
137
    def test_run(self):
138
138
        """Ensure the job scans the branch."""
187
187
            branch_format=BranchFormat.BZR_BRANCH_5,
188
188
            repository_format=RepositoryFormat.BZR_REPOSITORY_4)
189
189
        job = BranchUpgradeJob.create(branch, self.factory.makePerson())
190
 
        verifyObject(IBranchUpgradeJob, job)
 
190
        self.assertProvides(job, IBranchUpgradeJob)
191
191
 
192
192
    def test_upgrades_branch(self):
193
193
        """Ensure that a branch with an outdated format is upgraded."""
289
289
        branch = self.factory.makeAnyBranch()
290
290
        job = RevisionMailJob.create(
291
291
            branch, 0, 'from@example.com', 'hello', 'subject')
292
 
        verifyObject(IRevisionMailJob, job)
 
292
        self.assertProvides(job, IRevisionMailJob)
293
293
 
294
294
    def test_repr(self):
295
295
        """Ensure that the revision mail job as a reasonable repr."""
972
972
        self._makeProductSeries(
973
973
            TranslationsBranchImportMode.IMPORT_TEMPLATES)
974
974
        job = self._makeRosettaUploadJob()
975
 
        verifyObject(IRosettaUploadJob, job)
 
975
        self.assertProvides(job, IRosettaUploadJob)
976
976
 
977
977
    def test_upload_pot(self):
978
978
        # A POT can be uploaded to a product series that is