~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/archiveuploader/tests/test_buildduploads.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-18 13:47:37 UTC
  • mfrom: (13697.5.4 missing-test-bug-793607)
  • Revision ID: launchpad@pqm.canonical.com-20110818134737-izfe81407gzutbs3
[r=rvb,
        stevenk] [r=stevenk][bug=793607] Run tests in test_uploadprocessor.py
        with user 'uploader'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
180
180
        TestStagedBinaryUploadBase.setupBreezy(self)
181
181
        from lp.soyuz.model.processor import (
182
182
            Processor, ProcessorFamily)
 
183
        self.switchToAdmin()
183
184
        ppc_family = ProcessorFamily.selectOneBy(name='powerpc')
184
185
        ppc_proc = Processor(
185
186
            name='powerpc', title='PowerPC', description='not yet',
186
187
            family=ppc_family)
187
188
        breezy_ppc = self.breezy.newArch(
188
189
            'powerpc', ppc_family, True, self.breezy.owner)
 
190
        self.switchToUploader()
189
191
 
190
192
    def setUp(self):
191
193
        """Setup environment for binary uploads.
214
216
 
215
217
    def _publishBuildQueueItem(self, queue_item):
216
218
        """Publish build part of the given queue item."""
 
219
        self.switchToAdmin()
217
220
        queue_item.setAccepted()
218
221
        pubrec = queue_item.builds[0].publish(self.log)[0]
219
222
        pubrec.status = PackagePublishingStatus.PUBLISHED
220
223
        pubrec.datepublished = UTC_NOW
221
224
        queue_item.setDone()
 
225
        self.switchToUploader()
222
226
 
223
227
    def _setupUploadProcessorForBuild(self):
224
228
        """Setup an UploadProcessor instance for a given buildd context."""