class Test_do_motion(unittest.TestCase): def setUp(self): self.vi_run = ViRunCommand(mock.Mock()) def testCallsDebug(self): vi_cmd_data = {'motion': {'command': 'foo', 'args': {'bar': 100}}} with mock.patch.object(self.vi_run, 'debug') as db: self.vi_run.do_motion(vi_cmd_data) db.assert_called_once_with('Vintageous: Motion command: ', vi_cmd_data['motion']['command'], vi_cmd_data['motion']['args']) def testCallsRunCommand(self): vi_cmd_data = {'motion': {'command': 'foo', 'args': {'bar': 100}}} self.vi_run.do_motion(vi_cmd_data) self.vi_run.view.run_command.assert_called_once_with('foo', {'bar': 100})
class Test_do_motion(unittest.TestCase): def setUp(self): self.vi_run = ViRunCommand(mock.Mock()) def testCallsDebug(self): vi_cmd_data = {'motion': {'command': 'foo', 'args': {'bar': 100}}} with mock.patch.object(self.vi_run, 'debug') as db: self.vi_run.do_motion(vi_cmd_data) db.assert_called_once_with('Vintageous: Motion command: ', vi_cmd_data['motion']['command'], vi_cmd_data['motion']['args']) def testCallsRunCommand(self): vi_cmd_data = {'motion': {'command': 'foo', 'args': {'bar': 100}}} self.vi_run.do_motion(vi_cmd_data) self.vi_run.view.run_command.assert_called_once_with( 'foo', {'bar': 100})