Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Tardy <[email protected]>
  • Loading branch information
Pierre Tardy committed Feb 6, 2015
1 parent b5521bd commit 92c3cf2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/test/unit/test_buildslave_protocols_pb.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_remoteStartCommand(self):
conn.remoteSetBuilderList(builders)

RCInstance, builder_name, commandID = base.RemoteCommandImpl(), "builder", None
remote_command, args = "command", "args"
remote_command, args = "command", {"args": 'args'}

conn.remoteStartCommand(RCInstance, builder_name, commandID, remote_command, args)

Expand Down
5 changes: 4 additions & 1 deletion master/buildbot/test/unit/test_steps_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import stat

from buildbot.interfaces import BuildSlaveTooOldError
from buildbot.process import buildstep
from buildbot.process import properties
from buildbot.status.results import EXCEPTION
Expand Down Expand Up @@ -121,12 +122,14 @@ def test_render(self):
return self.runStep()

@compat.usesFlushLoggedErrors
@defer.inlineCallbacks
def test_old_version(self):
self.setupStep(slave.FileExists(file="x"),
slave_version=dict())
self.expectOutcome(result=EXCEPTION,
state_string="finished (exception)")
return self.runStep()
yield self.runStep()
self.flushLoggedErrors(BuildSlaveTooOldError)


class TestCopyDirectory(steps.BuildStepMixin, unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions master/docs/developer/cls-protocols.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ to know about protocol calls or handle protocol specific exceptions.
:returns: shallow copy of args dictionary with proxies instead of impls

Helper methods that will use :attr:`proxies`, and replace ``Impl`` objects by specific ``Proxy`` counterpart.
Helper method that will use :attr:`proxies`, and replace ``Impl`` objects by specific ``Proxy`` counterpart.

.. py:method:: notifyOnDisconnect(cb)
Expand Down Expand Up @@ -173,7 +173,7 @@ All the objects that are referenced from the slaves for remote calls have an ``I
Class used to implement data transfer between slave and master

.. :py:method:: remote_write(data)
:param data: data to write
data needs to be written on master side
Expand Down
8 changes: 6 additions & 2 deletions slave/buildslave/test/unit/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,19 @@ def test_getSlaveInfo(self):
d = self.bot.callRemote("getSlaveInfo")

def check(info):
self.assertEqual(info, dict(admin='testy!', foo='bar', environ=os.environ, system=os.name, basedir=self.basedir))
self.assertEqual(info, dict(
admin='testy!', foo='bar',
environ=os.environ, system=os.name, basedir=self.basedir,
slave_commands=self.real_bot.remote_getCommands(),
version=self.real_bot.remote_getVersion()))
d.addCallback(check)
return d

def test_getSlaveInfo_nodir(self):
d = self.bot.callRemote("getSlaveInfo")

def check(info):
self.assertEqual(set(info.keys()), set(['environ', 'system', 'basedir']))
self.assertEqual(set(info.keys()), set(['environ', 'system', 'basedir', 'slave_commands', 'version']))
d.addCallback(check)
return d

Expand Down

0 comments on commit 92c3cf2

Please sign in to comment.