def test_getCommandsBug(self): """getCommands returns a reasonable list if commands are specified.""" message = self.factory.makeSignedMessage(body=' bug foo') handler = MaloneHandler() commands = handler.getCommands(message) self.assertEqual(1, len(commands)) self.assertTrue(isinstance(commands[0], BugEmailCommand)) self.assertEqual('bug', commands[0].name) self.assertEqual(['foo'], commands[0].string_args)
def test_getCommandsEmpty(self): """getCommands returns an empty list for messages with no command.""" message = self.factory.makeSignedMessage() handler = MaloneHandler() self.assertEqual([], handler.getCommands(message))