~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

[r=allenap][bug=905853, 905855,
        906079] Revert r14499 and r14459 because read-only transactions in
        buildmaster are causing production issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2010 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 testtools.deferredruntest import AsynchronousDeferredRunTest
 
13
from twisted.trial.unittest import TestCase as TrialTestCase
14
14
from zope.component import getUtility
15
15
from zope.security.proxy import removeSecurityProxy
16
16
 
25
25
from lp.buildmaster.interfaces.builder import IBuilderSet
26
26
from lp.buildmaster.interfaces.buildqueue import IBuildQueue
27
27
from lp.buildmaster.interfaces.packagebuild import IPackageBuild
28
 
from lp.buildmaster.model.builder import BuilderSlave
29
28
from lp.buildmaster.model.buildqueue import BuildQueue
30
29
from lp.buildmaster.tests.mock_slaves import WaitingSlave
31
30
from lp.buildmaster.tests.test_packagebuild import (
54
53
    logout,
55
54
    TestCaseWithFactory,
56
55
    )
57
 
from lp.testing.fakemethod import FakeMethod
58
56
 
59
57
 
60
58
class TestBinaryPackageBuild(TestCaseWithFactory):
524
522
        self.build = gedit_src_hist.createMissingBuilds()[0]
525
523
 
526
524
        self.builder = self.factory.makeBuilder()
527
 
        self.patch(
528
 
            BuilderSlave, 'makeBuilderSlave',
529
 
            FakeMethod(WaitingSlave('BuildStatus.OK')))
 
525
        self.builder.setSlaveForTesting(WaitingSlave('BuildStatus.OK'))
530
526
        self.build.buildqueue_record.markAsBuilding(self.builder)
531
527
 
532
528
    def testDependencies(self):
572
568
 
573
569
 
574
570
class TestHandleStatusForBinaryPackageBuild(
575
 
    MakeBinaryPackageBuildMixin, TestHandleStatusMixin, TestCaseWithFactory):
 
571
    MakeBinaryPackageBuildMixin, TestHandleStatusMixin, TrialTestCase):
576
572
    """IPackageBuild.handleStatus works with binary builds."""
577
573
 
578
 
    layer = LaunchpadZopelessLayer
579
 
    run_tests_with = AsynchronousDeferredRunTest.make_factory(timeout=20)
580
 
 
581
574
 
582
575
class TestBinaryPackageBuildWebservice(TestCaseWithFactory):
583
576
    """Test cases for BinaryPackageBuild on the webservice.