# coding: utf-8

"""
    BeeKeeperAI EscrowAI Enclave API

    Described below is the EscrowAI Enclave API that provides functionality inside a BeeKeeperAI environment. Included are data engineering endpoints and reporting endpoints.

    The version of the OpenAPI document: 1.5.0
    Contact: engineering@beekeeperai.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from unittest.mock import create_autospec, patch, MagicMock
import unittest

import BeeKeeperRuntimeSDK
from BeeKeeperRuntimeSDK.api.escrow_api import EscrowApi  # noqa: E501
from BeeKeeperRuntimeSDK.rest import ApiException

# from BeeKeeperRuntimeSDK.models.``
from BeeKeeperRuntimeSDK.models.ping_enclave_get200_response import PingEnclaveGet200Response


class TestEscrowApi(unittest.TestCase):
    """EscrowApi unit test stubs"""

    @patch.object(
        BeeKeeperRuntimeSDK.api.escrow_api.ApiClient,
        "get_default",
        return_value=MagicMock(spec=BeeKeeperRuntimeSDK.api.escrow_api.ApiClient),
        autospec=True
    )
    def setUp(self, mock_client):
        self.api = BeeKeeperRuntimeSDK.api.escrow_api.EscrowApi()  # noqa: E501
        self.mock_api_client = mock_client

    def tearDown(self):
        pass

    def test_ping_attestation_get(self):
        """Test case for ping_attestation_get

        Ping attestation authority  # noqa: E501
        """
        self.mock_api_client.return_value.call_api.return_value = MagicMock(spec=PingEnclaveGet200Response)
        response = self.api.ping_attestation_get()
        self.mock_api_client.return_value.call_api.assert_called()
        args, kwargs = self.mock_api_client.return_value.call_api.call_args
        assert args[0] == '/ping-attestation'
        assert args[1] == 'GET'
        assert isinstance(response, PingEnclaveGet200Response)

    def test_ping_enclave_get(self):
        """Test case for ping_enclave_get

        Ping to check if the enclave API is up  # noqa: E500
        """
        self.mock_api_client.return_value.call_api.return_value = MagicMock(spec=PingEnclaveGet200Response)
        response = self.api.ping_enclave_get()
        self.mock_api_client.return_value.call_api.assert_called()
        args, kwargs = self.mock_api_client.return_value.call_api.call_args
        assert args[0] == '/ping-enclave'
        assert args[1] == 'GET'
        assert isinstance(response, PingEnclaveGet200Response)

    def test_ping_escrow_get(self):
        """Test case for ping_escrow_get

        Ping to check if the backend Escrow service is up  # noqa: E500
        """
        self.mock_api_client.return_value.call_api.return_value = MagicMock(spec=PingEnclaveGet200Response)
        response = self.api.ping_escrow_get()
        self.mock_api_client.return_value.call_api.assert_called()
        args, kwargs = self.mock_api_client.return_value.call_api.call_args
        assert args[0] == '/ping-escrow'
        assert args[1] == 'GET'
        assert isinstance(response, PingEnclaveGet200Response)

    def test_ping_kms_get(self):
        """Test case for ping_kms_get

        Ping key manager  # noqa: E500
        """
        self.mock_api_client.return_value.call_api.return_value = MagicMock(spec=PingEnclaveGet200Response)
        response = self.api.ping_kms_get()
        self.mock_api_client.return_value.call_api.assert_called()
        args, kwargs = self.mock_api_client.return_value.call_api.call_args
        assert args[0] == '/ping-kms'
        assert args[1] == 'GET'
        assert isinstance(response, PingEnclaveGet200Response)


if __name__ == '__main__':
    unittest.main()
