# 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 snapshots_api  # noqa: E501
from cohesivenet.rest import ApiException

from tests.openapi import generate_method_test
from tests.vns3.stub_data import SnapshotsApiData


class TestSnapshotsApi(object):
    """SnapshotsApi unit test stubs"""

    def test_delete_snapshot(self, rest_mocker, vns3_client, vns3_api_schema: dict):
        """Test case for delete_snapshot

        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "delete",
            "/snapshots/{snapshot_name}",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=SnapshotsApiData.SnapshotsListResponse,
        )(snapshots_api.delete_snapshot)

    def test_get_download_snapshot(
        self, rest_mocker, vns3_client, vns3_api_schema: dict
    ):
        """Test case for get_download_snapshot

        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "get",
            "/snapshots/{snapshot_name}",
            rest_mocker,
            resp_content_type="application/octet-stream",
            mock_request_from_schema=True,
            mock_response="asdfasdfasdf",
        )(snapshots_api.get_download_snapshot)

    def test_get_snapshots(self, rest_mocker, vns3_client, vns3_api_schema: dict):
        """Test case for get_snapshots

        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "get",
            "/snapshots",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=SnapshotsApiData.SnapshotsListResponse,
        )(snapshots_api.get_snapshots)

    def test_post_create_snapshot(
        self, rest_mocker, vns3_client, vns3_api_schema: dict
    ):
        """Test case for post_create_snapshot

        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "post",
            "/snapshots",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=SnapshotsApiData.SnapshotDetail,
        )(snapshots_api.post_create_snapshot)

    def test_put_import_snapshot(self, rest_mocker, vns3_client, vns3_api_schema: dict):
        """Test case for put_import_snapshot

        """
        generate_method_test(
            vns3_client,
            vns3_api_schema,
            "put",
            "/snapshots/running_config",
            rest_mocker,
            mock_request_from_schema=True,
            mock_response=SnapshotsApiData.SnapshotImportResponse,
        )(snapshots_api.put_import_snapshot)
