3 from cola
import cmdfactory
5 class UserInputWrapper(object):
14 def _echo(self
, *args
, **opts
):
18 class CommandFactoryTestCase(unittest
.TestCase
):
20 self
.factory
= cmdfactory
.CommandFactory()
21 self
.factory
.add_command_wrapper(UserInputWrapper())
23 def test_prompt_user_hello_world(self
):
24 self
.assertEquals(self
.factory
.prompt_user('hello'), 'world')
26 def test_prompt_user_echo(self
):
29 self
.assertEquals(self
.factory
.prompt_user('echo', *args
, **opts
),
32 def test_raises_on_unknown_callback(self
):
33 self
.assertRaises(NotImplementedError,
34 self
.factory
.prompt_user
, 'unknown-callback')
37 if __name__
== '__main__':