# 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 bgp_api
from cohesivenet.rest import ApiException

from tests.openapi import generate_method_test
from tests.vns3.stub_data import IpsecApiData, BGPApiData


class TestBGPApi(object):
    """BGPApi unit tests stubs"""

    def test_get_bgp_peer(self, rest_mocker, vns3_client, vns3_api_schema: dict):
        """Test case for delete_bgp_peer
        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "get",
            "/ipsec/endpoints/{endpoint_id}/ebgp_peers/{bgp_peer_id}",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=BGPApiData.BGPPeerDetail,
        )(bgp_api.get_bgp_peer)

    def test_delete_bgp_peer(self, rest_mocker, vns3_client, vns3_api_schema: dict):
        """Test case for delete_bgp_peer
        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "delete",
            "/ipsec/endpoints/{endpoint_id}/ebgp_peers/{bgp_peer_id}",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=IpsecApiData.IpsecEndpointDetail,
        )(bgp_api.delete_bgp_peer)

    def test_create_bgp_peer(self, rest_mocker, vns3_client, vns3_api_schema: dict):
        """Test case for test_create_bgp_peer
        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "post",
            "/ipsec/endpoints/{endpoint_id}/ebgp_peers",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=IpsecApiData.IpsecEndpointDetail,
        )(bgp_api.create_bgp_peer)

    def test_update_bgp_peer(self, rest_mocker, vns3_client, vns3_api_schema: dict):
        """Test case for test_update_bgp_peer
        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "put",
            "/ipsec/endpoints/{endpoint_id}/ebgp_peers/{bgp_peer_id}",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=IpsecApiData.IpsecEndpointDetail,
        )(bgp_api.update_bgp_peer)
