Exemplo n.º 1
0
    def test_getAvailableBuilderNames(self):
        sched = self.makeScheduler(name='tsched', builderNames=['a', 'b'],
                                   port='xxx', userpass=[('a', 'b')])
        persp = trysched.Try_Userpass_Perspective(sched, 'a')
        buildernames = yield persp.perspective_getAvailableBuilderNames()

        self.assertEqual(buildernames, ['a', 'b'])
Exemplo n.º 2
0
 def call_perspective_try(self, *args, **kwargs):
     sched = self.makeScheduler(name='tsched',
                                builderNames=['a', 'b'],
                                port='xxx',
                                userpass=[('a', 'b')],
                                properties=dict(frm='schd'))
     persp = trysched.Try_Userpass_Perspective(sched, 'a')
     return persp.perspective_try(*args, **kwargs)
Exemplo n.º 3
0
 def test_getAvailableBuilderNames(self):
     sched = self.makeScheduler(name='tsched', builderNames=['a', 'b'],
             port='xxx', userpass=[('a', 'b')])
     persp = trysched.Try_Userpass_Perspective(sched, 'a')
     d = defer.maybeDeferred(lambda :
             persp.perspective_getAvailableBuilderNames())
     def check(buildernames):
         self.assertEqual(buildernames, ['a', 'b'])
     d.addCallback(check)
     return d
Exemplo n.º 4
0
    def call_perspective_try(self, *args, **kwargs):
        sched = self.makeScheduler(name='tsched', builderNames=['a', 'b'],
                                   port='xxx', userpass=[('a', 'b')],
                                   properties=dict(frm='schd'))
        persp = trysched.Try_Userpass_Perspective(sched, 'a')

        # patch out all of the handling after addBuildsetForSourceStamp
        def getBuildset(bsid):
            return dict(bsid=bsid)
        self.db.buildsets.getBuildset = getBuildset

        rbss = yield persp.perspective_try(*args, **kwargs)

        if rbss is None:
            return
        self.assertIsInstance(rbss, trysched.RemoteBuildSetStatus)
Exemplo n.º 5
0
    def test_getAvailableBuilderNames(self):
        sched = self.makeScheduler(name='tsched',
                                   builderNames=['a', 'b'],
                                   port='xxx',
                                   userpass=[('a', 'b')])
        persp = trysched.Try_Userpass_Perspective(sched, 'a')
        d = defer.maybeDeferred(
            lambda: persp.perspective_getAvailableBuilderNames())

        def check(buildernames):
            self.assertEqual(buildernames, ['a', 'b'])

        d.addCallback(check)

        # Test that getAvailabelBuilderNames also accepts the properties
        # argument.
        d.addCallback(lambda _: persp.perspective_getAvailableBuilderNames(
            properties={'foo': 'bar'}))
        d.addCallback(check)

        return d