class TestHelp(unittest.TestCase): """Test email help.""" layer = ConfigLayer def setUp(self): self._mlist = create_list('*****@*****.**') self._help = Help() def test_too_many_arguments(self): # Error message when too many help arguments are given. results = Results() status = self._help.process(self._mlist, Message(), {}, ('more', 'than', 'one'), results) self.assertEqual(status, ContinueProcessing.no) self.assertEqual(str(results), """\ The results of your email command are provided below. help: too many arguments: more than one """) def test_no_such_command(self): # Error message when asking for help on an existent command. results = Results() status = self._help.process(self._mlist, Message(), {}, ('doesnotexist',), results) self.assertEqual(status, ContinueProcessing.no) self.assertEqual(str(results), """\ The results of your email command are provided below. help: no such command: doesnotexist """)
def setUp(self): self._mlist = create_list('*****@*****.**') self._help = Help()