def test_run_confirm(self, decision):
        flexmock(DialogHelper)
        DialogHelper.should_receive('ask_for_confirm_with_message').and_return(decision)
        comm = Command('ask_confirm', {}, {'__ui__': 'cli'})
        res = self.acr(comm).run()

        assert res[0] is decision
        assert res[1] == decision
    def test_run_input(self, inp):
        flexmock(DialogHelper)
        DialogHelper.should_receive('ask_for_input_with_prompt').and_return(inp)
        comm = Command('ask_input', {}, {'__ui__': 'cli'})
        res = self.acr(comm).run()

        assert res[0] is bool(inp)
        assert res[1] == inp
    def test_run_password(self):
        flexmock(DialogHelper)
        DialogHelper.should_receive('ask_for_password').and_return('foobar')
        comm = Command('ask_password', {}, {'__ui__': 'cli'})
        res = self.acr(comm).run()

        assert res[0] is True
        assert res[1] == 'foobar'
Ejemplo n.º 4
0
    def test_run_password(self):
        flexmock(DialogHelper)
        DialogHelper.should_receive('ask_for_password').and_return('foobar')
        comm = Command('ask_password', {}, {'__ui__': 'cli'})
        res = self.acr(comm).run()

        assert res[0] is True
        assert res[1] == 'foobar'
Ejemplo n.º 5
0
    def test_run_confirm(self, decision):
        flexmock(DialogHelper)
        DialogHelper.should_receive('ask_for_confirm_with_message').and_return(
            decision)
        comm = Command('ask_confirm', {}, {'__ui__': 'cli'})
        res = self.acr(comm).run()

        assert res[0] is decision
        assert res[1] == decision
Ejemplo n.º 6
0
    def test_run_input(self, inp):
        flexmock(DialogHelper)
        DialogHelper.should_receive('ask_for_input_with_prompt').and_return(
            inp)
        comm = Command('ask_input', {}, {'__ui__': 'cli'})
        res = self.acr(comm).run()

        assert res[0] is bool(inp)
        assert res[1] == inp