def test_handle_message_action_not_mine(self): message = {'type': 'message', 'data': 'another}|{/act hi'} self.assertEqual(msg_handler.handle_message(message, 'test'), ('<b>another</b>: <strong>hi</strong>', False))
def test_handle_message_header_not_mine(self): message = {'type': 'message', 'data': 'another}|{/header hi'} self.assertEqual(msg_handler.handle_message(message, 'test'), ('</br><center class="another" style="font-size:1.5em;font-weight:bold;">hi</center>', False))
def test_handle_message_action_mine(self): message = {'type': 'message', 'data': 'test}|{/act hi'} self.assertEqual(msg_handler.handle_message(message, 'test'), ('<b>test</b>: <strong>hi</strong>', True))
def test_handle_message_default_not_mine(self): message = {'type': 'message', 'data': 'another}|{hi'} self.assertEqual(msg_handler.handle_message(message, 'test'), ('<b>another</b>: hi', False))
def test_handle_message_default_mine(self): message = {'type': 'message', 'data': 'test}|{hi'} self.assertEqual(msg_handler.handle_message(message, 'test'), ('<b>test</b>: hi', True))
def test_handle_message_subscribe(self): message = {'type': 'subscribe', 'data': '/quit test'} self.assertEqual(msg_handler.handle_message(message, 'test'), None)
def test_handle_message_quit(self): message = {'type': 'message', 'data': '/quit test'} self.assertEqual(msg_handler.handle_message(message, 'test'), ('quit', True))