Skip to content

Instantly share code, notes, and snippets.

@djmitche
Created January 17, 2011 22:05
Show Gist options
  • Select an option

  • Save djmitche/783588 to your computer and use it in GitHub Desktop.

Select an option

Save djmitche/783588 to your computer and use it in GitHub Desktop.
from buildbot.clients import sendchange
class FakeSender:
send_args = []
def send(self, *args, **kwargs):
self.send_args[0] = (args, kwargs)
return defer.succeed(None)
# in your test class:
def test_stuff(self):
self.patch(sendchange, 'Sender', FakeSender)
# .. call hook() ..
self.assertEqual(FakeSender.send_args[0], ( ( ... ), { ... } ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment