Created
January 17, 2011 22:05
-
-
Save djmitche/783588 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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