# coding: utf-8

"""
    VNS3:ms API

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

    Contact: solutions@cohesive.net
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import pytest

import cohesivenet
from cohesivenet.api.vns3ms import vns3_management_api  # noqa: E501
from cohesivenet.rest import ApiException

from tests.openapi import generate_method_test
from tests.vns3ms.stub_data import Vns3ManagementApiData


class TestMSVNS3ManagementApi(object):
    """VNS3:ms VNS3 Management API unit tests"""

    def test_get_vns3_snapshots(self, rest_mocker, ms_client, ms_api_schema: dict):
        """Test case for get_vns3_snapshots
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "GET",
            "/snapshots",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=Vns3ManagementApiData.Vns3SnapshotsList,
        )(vns3_management_api.get_vns3_snapshots)

    def test_post_create_vns3_snapshot(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for post_create_vns3_snapshot
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "POST",
            "/snapshots",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response={"response_type": "success", "response": "Snapshot created"},
        )(vns3_management_api.post_create_vns3_snapshot)

    def test_delete_vns3_snapshots(self, rest_mocker, ms_client, ms_api_schema: dict):
        """Test case for delete_vns3_snapshots
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "DELETE",
            "/snapshots",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.delete_vns3_snapshots)

    def test_get_download_vns3_snapshot(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for get_download_vns3_snapshot
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "GET",
            "/snapshots/download",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response="imafileimafileimafileimafileimafileimafileimafile",
        )(vns3_management_api.get_download_vns3_snapshot)

    def test_get_controller_report(self, rest_mocker, ms_client, ms_api_schema: dict):
        """Test case for get_controller_report
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "GET",
            "/system/controller_report",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=Vns3ManagementApiData.ControllerReport,
        )(vns3_management_api.get_controller_report)

    def test_get_vns3_controllers(self, rest_mocker, ms_client, ms_api_schema: dict):
        """Test case for get_vns3_controllers
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "GET",
            "/vns3_controllers",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=Vns3ManagementApiData.Vns3ControllerList,
        )(vns3_management_api.get_vns3_controllers)

    def test_post_add_vns3_controller(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for post_add_vns3_controller
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "POST",
            "/vns3_controllers",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=Vns3ManagementApiData.CreateVns3ControllerResponse,
        )(vns3_management_api.post_add_vns3_controller)

    def test_get_vns3_controller(self, rest_mocker, ms_client, ms_api_schema: dict):
        """Test case for get_vns3_controller
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "GET",
            "/vns3_controllers/{vns3_controller_id}",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=Vns3ManagementApiData.Vns3ControllerDetail,
        )(vns3_management_api.get_vns3_controller)

    def test_put_update_vns3_controller(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for put_update_vns3_controller
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "PUT",
            "/vns3_controllers/{vns3_controller_id}",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.put_update_vns3_controller)

    def test_delete_vns3_controller(self, rest_mocker, ms_client, ms_api_schema: dict):
        """Test case for delete_vns3_controller
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "DELETE",
            "/vns3_controllers/{vns3_controller_id}",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.delete_vns3_controller)

    def test_get_vns3_controller_status(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for get_vns3_controller_status
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "GET",
            "/vns3_controllers/{vns3_controller_id}/status",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.get_vns3_controller_status)

    def test_put_vns3_controller_api_password(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for put_vns3_controller_api_password
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "PUT",
            "/vns3_controllers/{vns3_controller_id}/update_api_password",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response={
                "response_type": "success",
                "response": "API password updated",
            },
        )(vns3_management_api.put_vns3_controller_api_password)

    def test_put_vns3_controller_ui(self, rest_mocker, ms_client, ms_api_schema: dict):
        """Test case for put_vns3_controller_ui
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "PUT",
            "/vns3_controllers/{vns3_controller_id}/update_ui",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response={
                "response_type": "success",
                "response": "UI details updated",
            },
        )(vns3_management_api.put_vns3_controller_ui)

    def test_get_vns3_controller_ha_details(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for get_vns3_controller_ha_details
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "GET",
            "/vns3_controllers/{vns3_controller_id}/ha",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=Vns3ManagementApiData.Vns3ControllerHaDetail,
        )(vns3_management_api.get_vns3_controller_ha_details)

    def test_put_update_vns3_controller_ha(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for put_update_vns3_controller_ha
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "PUT",
            "/vns3_controllers/{vns3_controller_id}/ha",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.put_update_vns3_controller_ha)

    def test_put_validate_vns3_controller_ha(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for put_validate_vns3_controller_ha
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "PUT",
            "/vns3_controllers/{vns3_controller_id}/ha/validate",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.put_validate_vns3_controller_ha)

    def test_put_init_vns3_controller_ha(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for put_init_vns3_controller_ha
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "PUT",
            "/vns3_controllers/{vns3_controller_id}/ha/initialise",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.put_init_vns3_controller_ha)

    def test_put_sync_vns3_controller_ha(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for put_sync_vns3_controller_ha
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "PUT",
            "/vns3_controllers/{vns3_controller_id}/ha/sync",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.put_sync_vns3_controller_ha)

    def test_put_activate_vns3_controller_ha(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for put_activate_vns3_controller_ha
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "PUT",
            "/vns3_controllers/{vns3_controller_id}/ha/activate",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.put_activate_vns3_controller_ha)

    def test_get_vns3_controller_ha_status(
        self, rest_mocker, ms_client, ms_api_schema: dict
    ):
        """Test case for get_vns3_controller_ha_status
        """
        generate_method_test(
            ms_client,
            ms_api_schema,
            "GET",
            "/vns3_controllers/{vns3_controller_id}/ha/activate",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response_from_schema=True,
        )(vns3_management_api.get_vns3_controller_ha_status)
