class TestLineInput(unittest.TestCase): def setUp(self): self.input = LineInput(DummyDatabase()) def test_input_ok(self): self.assertEqual(('ok', 'test'), self.input.consume('test test')) def test_input_no_method(self): self.assertEqual(('error', ''), self.input.consume('nothing command')) def test_input_bad_args(self): self.assertEqual(('error', ''), self.input.consume('test test test'))
def setUp(self): self.input = LineInput(DummyDatabase())