thousandeyes-sdk-python/thousandeyes-sdk-test-results/test/test_voice_rtp_server_test_metrics_api.py
Shahid Hussain Khan 9f18f0f6f2
[GitHub Bot] Generated python SDK (#42)
Co-authored-by: API Team <api-team@thousandeyes.com>
2024-08-11 09:57:09 +01:00

180 lines
7.1 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.voice_rtp_server_test_metrics_api import VoiceRTPServerTestMetricsApi
class TestVoiceRTPServerTestMetricsApi(unittest.TestCase):
"""VoiceRTPServerTestMetricsApi unit test stubs"""
def setUp(self) -> None:
self.api = VoiceRTPServerTestMetricsApi()
def tearDown(self) -> None:
pass
def test_get_test_rtp_server_results_models_validation(self) -> None:
"""Test case for get_test_rtp_server_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"
},
"pdv" : 1,
"_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"
}
},
"dscpName" : "EF (DSCP 46)",
"latency" : 103,
"mos" : 4.351024,
"loss" : 0.0,
"dscp" : "46",
"codecMaxMos" : 4.41,
"discards" : 0.0,
"serverIp" : "172.97.102.37",
"errorDetail" : "Connection error",
"startTime" : 1384309800,
"endTime" : 1384309800,
"codecName" : "G.711 @ 64 Kbps",
"roundId" : 1384309800
}, {
"date" : "2022-07-17T22:00:54Z",
"agent" : {
"agentId" : "281474976710706",
"agentName" : "thousandeyes-stg-va-254",
"location" : "San Francisco Bay Area",
"countryId" : "US"
},
"pdv" : 1,
"_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"
}
},
"dscpName" : "EF (DSCP 46)",
"latency" : 103,
"mos" : 4.351024,
"loss" : 0.0,
"dscp" : "46",
"codecMaxMos" : 4.41,
"discards" : 0.0,
"serverIp" : "172.97.102.37",
"errorDetail" : "Connection error",
"startTime" : 1384309800,
"endTime" : 1384309800,
"codecName" : "G.711 @ 64 Kbps",
"roundId" : 1384309800
} ],
"startDate" : "2022-07-17T22:00:54Z"
}"""
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.test_results.models.RtpStreamTestResults.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':
unittest.main()