~bigkevmcd/offspring/bug-1039135-fix-notifications

« back to all changes in this revision

Viewing changes to lib/offspring/slave/tests/test_slave.py

  • Committer: Cody A.W. Somerville
  • Author(s): Kevin McDermott
  • Date: 2012-04-10 02:58:27 UTC
  • mfrom: (128.1.1 fix-bug-967279)
  • Revision ID: cody.somerville@canonical.com-20120410025827-a8ywsi22z37lsapw
Fix api issue with build job dispatch to slaves (LP #967279) [r=Cody]

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
        self.state = state
192
192
        self.config = config
193
193
 
194
 
    def startBuild(self, project_name, config_url, lp_user=None,
195
 
                   lp_sshkey=None):
 
194
    def startBuild(self, project_name, config_url):
196
195
        self.project_name = project_name
197
196
        self.config_url = config_url
198
 
        self.lp_user = lp_user
199
 
        self.private_key = lp_sshkey
200
197
        self.started = True
201
198
 
202
199
    def stopBuild(self):
298
295
        self.assertFalse(self.fake_slave.project_name)
299
296
        self.assertFalse(self.fake_slave.config_url)
300
297
 
301
 
    def test_api_start_build_with_private_project_details(self):
302
 
        """
303
 
        If the lpSSHKey and lpUser are supplied, then these should be passed to
304
 
        the underlying SlaveServer.
305
 
        """
306
 
        self.fake_slave.currentBuild = FakeBuild()
307
 
        slave_server = self.create_slave_server()
308
 
 
309
 
        response = slave_server.api_startBuild("testing",
310
 
                                               "http://example.com/",
311
 
                                               "testing",
312
 
                                               "private_key")
313
 
        self.assertEqual(LexbuilderSlaveServer.REQUEST_OKAY, response)
314
 
        self.assertEqual("testing", self.fake_slave.project_name)
315
 
        self.assertEqual("http://example.com/", self.fake_slave.config_url)
316
 
        self.assertEqual("testing", self.fake_slave.lp_user)
317
 
        self.assertEqual("private_key", self.fake_slave.private_key)
318
 
        self.assertTrue(self.fake_slave.started)
319
 
 
320
298
    def test_api_stop_build(self):
321
299
        """
322
300
        If the SlaveServer has an active build, api_stopBuild should end the