thousandeyes-sdk-python/thousandeyes-sdk-test-results/test/test_dnssec_test_metrics_api.py
2024-08-11 08:40:23 +00:00

162 lines
6.3 KiB
Python

# coding: utf-8
"""
Test Results API
Get test result metrics for Cloud and Enterprise Agent tests.
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.dnssec_test_metrics_api import DNSSECTestMetricsApi
class TestDNSSECTestMetricsApi(unittest.TestCase):
"""DNSSECTestMetricsApi unit test stubs"""
def setUp(self) -> None:
self.api = DNSSECTestMetricsApi()
def tearDown(self) -> None:
pass
def test_get_test_dns_sec_results_models_validation(self) -> None:
"""Test case for get_test_dns_sec_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",
"agent" : {
"agentId" : "281474976710706",
"agentName" : "thousandeyes-stg-va-254",
"location" : "San Francisco Bay Area",
"countryId" : "US"
},
"_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"
}
},
"isValid" : true,
"startTime" : 1384309800,
"endTime" : 1384309800,
"roundId" : 1384309800,
"errorDetails" : "Connection error"
}, {
"date" : "2022-07-17T22:00:54Z",
"agent" : {
"agentId" : "281474976710706",
"agentName" : "thousandeyes-stg-va-254",
"location" : "San Francisco Bay Area",
"countryId" : "US"
},
"_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"
}
},
"isValid" : true,
"startTime" : 1384309800,
"endTime" : 1384309800,
"roundId" : 1384309800,
"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.DnssecTestResults.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':
unittest.main()