~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/tests/test_binarypackagebuild.py

[r=allenap, bac, gmb, julian-edwards, wallyworld][bug=905853, 905855,
 906079] In buildmaster,
 always shift into a read-write database transaction access mode before
 updating PackageBuild statuses. Shift into read-write transactions in
 appropriate places in TranslationTemplatesBuildBehavior. Ensure that all
 lp.buildmaster tests to which it is relevant are running with
 BuilddManagerTestFixture.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Test Build features."""
10
10
 
11
11
import pytz
12
12
from storm.store import Store
13
 
from twisted.trial.unittest import TestCase as TrialTestCase
14
13
from zope.component import getUtility
15
14
from zope.security.proxy import removeSecurityProxy
16
15
 
18
17
from lp.buildmaster.interfaces.builder import IBuilderSet
19
18
from lp.buildmaster.interfaces.buildqueue import IBuildQueue
20
19
from lp.buildmaster.interfaces.packagebuild import IPackageBuild
 
20
from lp.buildmaster.model.builder import BuilderSlave
21
21
from lp.buildmaster.model.buildqueue import BuildQueue
22
22
from lp.buildmaster.tests.mock_slaves import WaitingSlave
23
23
from lp.buildmaster.tests.test_packagebuild import (
48
48
    logout,
49
49
    TestCaseWithFactory,
50
50
    )
 
51
from lp.testing.fakemethod import FakeMethod
51
52
from lp.testing.layers import (
52
53
    DatabaseFunctionalLayer,
53
54
    LaunchpadZopelessLayer,
522
523
        self.build = gedit_src_hist.createMissingBuilds()[0]
523
524
 
524
525
        self.builder = self.factory.makeBuilder()
525
 
        self.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK'))
 
526
        self.patch(
 
527
            BuilderSlave, 'makeBuilderSlave',
 
528
            FakeMethod(WaitingSlave('BuildStatus.OK')))
526
529
        self.build.buildqueue_record.markAsBuilding(self.builder)
527
530
 
528
531
    def testDependencies(self):
568
571
 
569
572
 
570
573
class TestHandleStatusForBinaryPackageBuild(
571
 
    MakeBinaryPackageBuildMixin, TestHandleStatusMixin, TrialTestCase):
 
574
    MakeBinaryPackageBuildMixin, TestHandleStatusMixin, TestCaseWithFactory):
572
575
    """IPackageBuild.handleStatus works with binary builds."""
573
576
 
574
577