# coding: utf-8

"""
    VNS3 Controller API

    Cohesive networks VNS3 API providing complete control of your network's addresses, routes, rules and edge  # noqa: E501

    The version of the OpenAPI document: 4.8
    Contact: solutions@cohesive.net
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import pytest

import cohesivenet
from cohesivenet.api.vns3 import configuration_api
from cohesivenet.rest import ApiException

from tests.openapi import generate_method_test
from tests.stub_data import ConfigurationApiData


class TestConfigurationApi(object):
    """AccessApi unit tests stubs"""

    def test_get_config(self, rest_mocker, api_client, api_schema: dict):
        """Test case for get_config
        """
        generate_method_test(
            api_client,
            api_schema,
            "get",
            "/config",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=ConfigurationApiData.ConfigDetail,
        )(configuration_api.get_config)

    def test_get_keyset(self, rest_mocker, api_client, api_schema: dict):
        """Test case for get_keyset
        """
        generate_method_test(
            api_client,
            api_schema,
            "get",
            "/keyset",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=ConfigurationApiData.KeysetDetail,
        )(configuration_api.get_keyset)

    def test_get_ssl_install_status(self, rest_mocker, api_client, api_schema: dict):
        """Test case for get_ssl_install_status
        """
        generate_method_test(
            api_client,
            api_schema,
            "get",
            "/system/ssl/install/{uuid}",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(configuration_api.get_ssl_install_status)

    def test_put_config(self, rest_mocker, api_client, api_schema: dict):
        """Test case for put_config
        """
        generate_method_test(
            api_client,
            api_schema,
            "put",
            "/config",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=ConfigurationApiData.ConfigDetail,
        )(configuration_api.put_config)

    def test_put_install_ssl_keypair(self, rest_mocker, api_client, api_schema: dict):
        """Test case for put_install_ssl_keypair
        """
        generate_method_test(
            api_client,
            api_schema,
            "put",
            "/system/ssl/install",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(configuration_api.put_install_ssl_keypair)

    def test_put_keyset(self, rest_mocker, api_client, api_schema: dict):
        """Test case for put_keyset
        """
        generate_method_test(
            api_client,
            api_schema,
            "put",
            "/keyset",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=ConfigurationApiData.KeysetDetail,
        )(configuration_api.put_keyset)

    def test_put_update_admin_ui(self, rest_mocker, api_client, api_schema: dict):
        """Test case for put_update_admin_ui
        """
        generate_method_test(
            api_client,
            api_schema,
            "put",
            "/admin_ui",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=ConfigurationApiData.UpdateUIAdminResponse,
        )(configuration_api.put_update_admin_ui)

    def test_put_update_api_password(self, rest_mocker, api_client, api_schema: dict):
        """Test case for put_update_api_password
        """
        generate_method_test(
            api_client,
            api_schema,
            "put",
            "/api_password",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response={"response": {"password_reset": "ok"}},
        )(configuration_api.put_update_api_password)

    def test_put_upload_ssl_keypair(self, rest_mocker, api_client, api_schema: dict):
        """Test case for put_upload_ssl_keypair
        """
        generate_method_test(
            api_client,
            api_schema,
            "put",
            "/system/ssl/keypair",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response={"response": "Valid key/cert files uploaded"},
        )(configuration_api.put_upload_ssl_keypair)

    def test_try_get_keyset(self, rest_mocker, api_client, api_schema: dict):
        """Test case for put_expire_access_url
        """
        generate_method_test(
            api_client,
            api_schema,
            "get",
            "/keyset",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=ConfigurationApiData.KeysetDetail,
        )(configuration_api.try_get_keyset)

    def test_wait_for_keyset(self, rest_mocker, api_client, api_schema: dict):
        """Test case for wait_for_keyset
        """
        generate_method_test(
            api_client,
            api_schema,
            "get",
            "/keyset",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=ConfigurationApiData.KeysetDetail,
        )(configuration_api.wait_for_keyset)
