# coding: utf-8 """ Test Results API Get test result metrics for Cloud and Enterprise Agent tests. The version of the OpenAPI document: 7.0.8 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 import json import unittest import thousandeyes_sdk.test_results.models from .test_utils import assert_constructed_model_matches_example_json from thousandeyes_sdk.test_results.api.dns_server_test_metrics_api import DNSServerTestMetricsApi class TestDNSServerTestMetricsApi(unittest.TestCase): """DNSServerTestMetricsApi unit test stubs""" def setUp(self) -> None: self.api = DNSServerTestMetricsApi() def tearDown(self) -> None: pass def test_get_test_dns_server_result_models_validation(self) -> None: """Test case for get_test_dns_server_result request and response models""" response_body_json = """ { "test" : { "_links" : { "testResults" : [ { "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" }, { "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" } ], "self" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" } }, "liveShare" : false, "savedEvent" : true, "description" : "ThousandEyes Test", "type" : "agent-to-server", "enabled" : true, "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "modifiedDate" : "2022-07-17T22:00:54Z", "interval" : 120, "modifiedBy" : "user@user.com", "testId" : "281474976710706", "alertsEnabled" : true, "testName" : "ThousandEyes Test" }, "endDate" : "2022-07-18T22:00:54Z", "_links" : { "next" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" }, "previous" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" }, "self" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" } }, "results" : [ { "date" : "2022-07-17T22:00:54Z", "server" : "a1.verisigndns.com.", "agent" : { "agentId" : "281474976710706", "agentName" : "thousandeyes-stg-va-254", "location" : "San Francisco Bay Area", "countryId" : "US" }, "mappings" : "208.185.7.120", "_links" : { "appLink" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" } }, "startTime" : 1384309800, "endTime" : 1384309800, "resolutionTime" : 3, "roundId" : 1384309800, "serverId" : "456", "errorDetails" : "Connection error" }, { "date" : "2022-07-17T22:00:54Z", "server" : "a1.verisigndns.com.", "agent" : { "agentId" : "281474976710706", "agentName" : "thousandeyes-stg-va-254", "location" : "San Francisco Bay Area", "countryId" : "US" }, "mappings" : "208.185.7.120", "_links" : { "appLink" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" } }, "startTime" : 1384309800, "endTime" : 1384309800, "resolutionTime" : 3, "roundId" : 1384309800, "serverId" : "456", "errorDetails" : "Connection error" } ], "startDate" : "2022-07-17T22:00:54Z" }""" response_loaded_json = json.loads(response_body_json) response_from_json = thousandeyes_sdk.test_results.models.DnsServerTestResults.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) def test_get_test_dns_servers_results_models_validation(self) -> None: """Test case for get_test_dns_servers_results request and response models""" response_body_json = """ { "test" : { "_links" : { "testResults" : [ { "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" }, { "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" } ], "self" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" } }, "liveShare" : false, "savedEvent" : true, "description" : "ThousandEyes Test", "type" : "agent-to-server", "enabled" : true, "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "modifiedDate" : "2022-07-17T22:00:54Z", "interval" : 120, "modifiedBy" : "user@user.com", "testId" : "281474976710706", "alertsEnabled" : true, "testName" : "ThousandEyes Test" }, "endDate" : "2022-07-18T22:00:54Z", "_links" : { "next" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" }, "previous" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" }, "self" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" } }, "results" : [ { "date" : "2022-07-17T22:00:54Z", "server" : "a1.verisigndns.com.", "agent" : { "agentId" : "281474976710706", "agentName" : "thousandeyes-stg-va-254", "location" : "San Francisco Bay Area", "countryId" : "US" }, "mappings" : "208.185.7.120", "_links" : { "appLink" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" } }, "startTime" : 1384309800, "endTime" : 1384309800, "resolutionTime" : 3, "roundId" : 1384309800, "serverId" : "456", "errorDetails" : "Connection error" }, { "date" : "2022-07-17T22:00:54Z", "server" : "a1.verisigndns.com.", "agent" : { "agentId" : "281474976710706", "agentName" : "thousandeyes-stg-va-254", "location" : "San Francisco Bay Area", "countryId" : "US" }, "mappings" : "208.185.7.120", "_links" : { "appLink" : { "hreflang" : "hreflang", "templated" : true, "profile" : "profile", "name" : "name", "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", "type" : "type", "deprecation" : "deprecation", "title" : "title" } }, "startTime" : 1384309800, "endTime" : 1384309800, "resolutionTime" : 3, "roundId" : 1384309800, "serverId" : "456", "errorDetails" : "Connection error" } ], "startDate" : "2022-07-17T22:00:54Z" }""" response_loaded_json = json.loads(response_body_json) response_from_json = thousandeyes_sdk.test_results.models.DnsServerTestResults.from_json(response_body_json) assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) if __name__ == '__main__': unittest.main()