Created
August 18, 2016 02:20
-
-
Save jrabbit/8cbec7443ee8d3deb3c2f8fac6ab7c5e 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
@mock.patch('random.choice') | |
def test_nick_replace(self, patched_choice): | |
mod = pyborg_irc2.ModIRC(pyborg.pyborg.pyborg, self.settings) | |
our_event = irc.client.Event(type=None, source=None, target="#botally") | |
mocked_channel = mock.Mock() | |
patched_choice.return_value = "jrabbit" | |
# mocked_channel.return_value.users = ['jrabbit'] | |
# mocked_channel.users.return_value = ["jrabbit"] | |
mod.channels = {"#botally": mocked_channel} | |
msg = "#nick is the best bot maker!" | |
output = mod.replace_nicks(msg, our_event) | |
mocked_channel.users.assert_called_with() | |
self.assertEqual(output, "jrabbit is the best bot maker!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment