Пример #1
0
class Test_do_pre_motion(unittest.TestCase):
    def setUp(self):
        self.vi_run = ViRunCommand(mock.Mock())

    def testDoesNotRunIfUnset(self):
        vi_cmd_data = {'pre_motion': []}
        self.vi_run.do_pre_motion(vi_cmd_data)
        self.assertEqual(self.vi_run.view.run_command.call_count, 0)

    def testRunsAsExpectedIfSet(self):
        vi_cmd_data = {'post_motion': [['foo', {'bar': 100}]]}
        self.vi_run.do_post_motion(vi_cmd_data)
        self.vi_run.view.run_command.assert_called_once_with('foo', {'bar': 100})
Пример #2
0
class Test_do_pre_motion(unittest.TestCase):
    def setUp(self):
        self.vi_run = ViRunCommand(mock.Mock())

    def testDoesNotRunIfUnset(self):
        vi_cmd_data = {'pre_motion': []}
        self.vi_run.do_pre_motion(vi_cmd_data)
        self.assertEqual(self.vi_run.view.run_command.call_count, 0)

    def testRunsAsExpectedIfSet(self):
        vi_cmd_data = {'post_motion': [['foo', {'bar': 100}]]}
        self.vi_run.do_post_motion(vi_cmd_data)
        self.vi_run.view.run_command.assert_called_once_with(
            'foo', {'bar': 100})