def test_RemoteOperation_logger_debug(self, mock_split, mock_cmd, mock_lods, mock_debug): mock_cmd.run = MagicMock() mockRemoteOperation = RemoteOperation(operation=TestOperation(), host="sdw1", msg_ctx="dbid 2") mockRemoteOperation.execute() mock_debug.assert_called() first_call_args, fist_call_kwargs = mock_debug.call_args_list[0] self.assertTrue(first_call_args[0].startswith("Output for dbid 2 on host sdw1:"))
def test_RemoteOperation_logger_debug(self, mock_split, mock_cmd, mock_lods, mock_debug): # We want to lock down the Command's get_results().stdout. cmd_instance = mock_cmd.return_value cmd_instance.get_results.return_value.stdout = 'output' mockRemoteOperation = RemoteOperation(operation=TestOperation(), host="sdw1", msg_ctx="dbid 2") mockRemoteOperation.execute() mock_debug.assert_has_calls([mock.call("Output for dbid 2 on host sdw1: output")])
def test_RemoteOperation_logger_debug(self, mock_split, mock_cmd, mock_lods, mock_debug): # We want to lock down the Command's get_results().stdout. cmd_instance = mock_cmd.return_value cmd_instance.get_results.return_value.stdout = 'output' mockRemoteOperation = RemoteOperation(operation=TestOperation(), host="sdw1", msg_ctx="dbid 2") mockRemoteOperation.execute() mock_debug.assert_has_calls([mock.call("Output for dbid 2 on host sdw1: output")])