def test_close(self, mock_client, mock_end_session):
        mock_client.return_value = mock_client
        session = SessionClient(MOCK_LEDGER_NAME, MOCK_TOKEN, mock_client,
                                MOCK_ID)
        session._close()

        mock_end_session.assert_called_once_with()
    def test_close_client_error(self, mock_client, mock_end_session,
                                mock_logger_warning):
        mock_client.return_value = mock_client
        session = SessionClient(MOCK_LEDGER_NAME, MOCK_TOKEN, mock_client,
                                MOCK_ID)
        ce = ClientError(MOCK_CLIENT_ERROR_MESSAGE, MOCK_ERROR_MESSAGE)
        mock_end_session.side_effect = ce

        session._close()
        mock_end_session.assert_called_once_with()
        mock_logger_warning.assert_called_once()