def test_execute_statement_default_parameters(self, mock_send_command,
                                                  mock_to_value_holder,
                                                  mock_client):
        mock_client.return_value = mock_client
        mock_send_command.return_value = MOCK_EXECUTE_STATEMENT_RESULT
        session = SessionClient(MOCK_LEDGER_NAME, MOCK_TOKEN, mock_client,
                                MOCK_ID)
        result = session._execute_statement(MOCK_TRANSACTION_ID,
                                            MOCK_STATEMENT, [])

        mock_send_command.assert_called_once_with({
            'SessionToken': MOCK_TOKEN,
            'ExecuteStatement': {
                'TransactionId': MOCK_TRANSACTION_ID,
                'Statement': MOCK_STATEMENT,
                'Parameters': []
            }
        })
        mock_to_value_holder.assert_not_called()
        mock_send_command.assert_called_once()
        self.assertEqual(result, MOCK_RESULT_RESULT)
    def test_execute_statement(self, mock_send_command, mock_to_value_holder,
                               mock_client):
        mock_client.return_value = mock_client
        mock_send_command.return_value = MOCK_EXECUTE_STATEMENT_RESULT
        mock_to_value_holder.return_value = mock_to_value_holder
        session = SessionClient(MOCK_LEDGER_NAME, MOCK_TOKEN, mock_client,
                                MOCK_ID)
        result = session._execute_statement(MOCK_TRANSACTION_ID,
                                            MOCK_STATEMENT, MOCK_PARAMETERS)

        mock_send_command.assert_called_once_with({
            'SessionToken': MOCK_TOKEN,
            'ExecuteStatement': {
                'TransactionId': MOCK_TRANSACTION_ID,
                'Statement': MOCK_STATEMENT,
                'Parameters': [mock_to_value_holder, mock_to_value_holder]
            }
        })
        mock_to_value_holder.assert_has_calls(
            [call(MOCK_PARAMETERS[0]),
             call(MOCK_PARAMETERS[1])])
        self.assertEqual(result, MOCK_RESULT_RESULT)