def test_get_widget_data_for_non_widget_messages(self) -> None: # This is a pretty important test, despite testing the # "negative" case. We never want widgets to interfere # with normal messages. test_messages = [ '', ' ', 'this is an ordinary message', '/bogus_command', '/me shrugs', 'use /poll', ] for message in test_messages: self.assertEqual(get_widget_data(content=message), (None, None)) # Add a positive check for context self.assertEqual(get_widget_data(content='/tictactoe'), ('tictactoe', None))
def test_get_widget_data_for_non_widget_messages(self) -> None: # This is a pretty important test, despite testing the # "negative" case. We never want widgets to interfere # with normal messages. test_messages = [ "", " ", "this is an ordinary message", "/bogus_command", "/me shrugs", "use /poll", ] for message in test_messages: self.assertEqual(get_widget_data(content=message), (None, None)) # Add a positive check for context self.assertEqual(get_widget_data(content="/todo"), ("todo", None))