remove the speaker from messages coming over the bridge when learning
This commit is contained in:
@@ -33,3 +33,16 @@ class MarkovTestCase(TestCase):
|
||||
self.plugin.handle_chatter(self.mock_connection, mock_event)
|
||||
|
||||
self.assertEqual(mock_learn_line.call_args.args[0], 'hello this is a test message')
|
||||
|
||||
def test_learn_bridge_edit(self):
|
||||
"""Test that we don't learn the speaker's nick when learning a message from the bridge."""
|
||||
mock_event = mock.MagicMock()
|
||||
mock_event.arguments = ['<tester> hello this is a test message']
|
||||
mock_event.target = '#test'
|
||||
mock_event.recursing = False
|
||||
mock_event.source = 'bridge!bridge@localhost'
|
||||
|
||||
with mock.patch('markov.lib.learn_line') as mock_learn_line:
|
||||
self.plugin.handle_chatter(self.mock_connection, mock_event)
|
||||
|
||||
self.assertEqual(mock_learn_line.call_args.args[0], 'hello this is a test message')
|
||||
|
||||
Reference in New Issue
Block a user