def test_run_command_clear_matrix(self): ctx = editor.Context(editor.Matrix) ctx.create(3, 4) mock_matrix = ctx.instance mock_matrix.clear = MagicMock() editor.run_command(ctx, 'C') mock_matrix.clear.assert_called_with()
def test_run_command_invalid_command(self): ctx = editor.Context(editor.Matrix) ctx.create(3, 4) assert editor.run_command(ctx, 'Z') is None
def test_run_command_create_matrix(self): ctx = editor.Context(editor.Matrix) ctx.create = MagicMock() editor.run_command(ctx, 'I 3 4') ctx.create.assert_called_with(3, 4)