test the ability to not learn our nick when addressed
This commit is contained in:
parent
ec1767e38b
commit
debf086b8d
@ -34,6 +34,32 @@ class MarkovTestCase(TestCase):
|
||||
|
||||
self.assertEqual(mock_learn_line.call_args.args[0], 'hello this is a test message')
|
||||
|
||||
def test_learn_self_edit(self):
|
||||
"""Test that we don't learn our own name when learning something addressed to us."""
|
||||
mock_event = mock.MagicMock()
|
||||
mock_event.arguments = ['test_bot: hello this is a test message']
|
||||
mock_event.target = '#test'
|
||||
mock_event.recursing = False
|
||||
|
||||
with mock.patch('markov.lib.learn_line') as mock_learn_line:
|
||||
with mock.patch('markov.lib.generate_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')
|
||||
|
||||
def test_learn_variant_self_edit(self):
|
||||
"""Test that we don't learn our own name when learning something addressed to us, discord style."""
|
||||
mock_event = mock.MagicMock()
|
||||
mock_event.arguments = ['@test_bot hello this is a test message']
|
||||
mock_event.target = '#test'
|
||||
mock_event.recursing = False
|
||||
|
||||
with mock.patch('markov.lib.learn_line') as mock_learn_line:
|
||||
with mock.patch('markov.lib.generate_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')
|
||||
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user