mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2025-12-06 06:26:51 +00:00
1017 lines
46 KiB
Python
1017 lines
46 KiB
Python
# coding: utf-8
|
|
|
|
"""
|
|
Endpoint Test Results API
|
|
|
|
Retrieve results for scheduled and dynamic tests on endpoint agents.
|
|
|
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
|
|
Do not edit the class manually.
|
|
""" # noqa: E501
|
|
|
|
|
|
import json
|
|
import unittest
|
|
import thousandeyes_sdk.endpoint_test_results.models
|
|
|
|
from .test_utils import assert_constructed_model_matches_example_json
|
|
from thousandeyes_sdk.endpoint_test_results.api.real_user_endpoint_test_results_api import RealUserEndpointTestResultsApi
|
|
|
|
|
|
class TestRealUserEndpointTestResultsApi(unittest.TestCase):
|
|
"""RealUserEndpointTestResultsApi unit test stubs"""
|
|
|
|
def setUp(self) -> None:
|
|
self.api = RealUserEndpointTestResultsApi()
|
|
|
|
def tearDown(self) -> None:
|
|
pass
|
|
|
|
def test_filter_real_user_tests_network_results_models_validation(self) -> None:
|
|
"""Test case for filter_real_user_tests_network_results request and response models"""
|
|
request_body_json = """
|
|
{
|
|
"searchFilters" : {
|
|
"agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
|
|
"bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
|
|
"visitedSite" : [ "app.thousandeyes.com" ],
|
|
"trigger" : [ "user" ],
|
|
"ssid" : [ "wifi-name", "other-room-wifi" ],
|
|
"platform" : [ "mac", "mac" ],
|
|
"proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
|
|
"destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
|
|
"domain" : [ "thousandeyes.com" ],
|
|
"location" : [ "San Francisco Bay Area", "Germany" ],
|
|
"connection" : [ "wireless", "wireless" ],
|
|
"vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
|
|
"networkId" : [ "660b34109d12", "660b34109d15" ],
|
|
"gateway" : [ "78.153.54.204", "78.153.54.206" ]
|
|
}
|
|
}"""
|
|
|
|
request_loaded_json = json.loads(request_body_json)
|
|
request_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
|
|
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
|
|
|
|
response_body_json = """
|
|
{
|
|
"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"
|
|
}
|
|
},
|
|
"results" : [ {
|
|
"date" : "2022-07-17T22:00:54Z",
|
|
"proxy" : {
|
|
"loss" : 0.1,
|
|
"jitter" : 46,
|
|
"latency" : 150,
|
|
"target" : "54.208.6.220"
|
|
},
|
|
"agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
|
|
"systemMetrics" : {
|
|
"cpuUtilization" : {
|
|
"min" : 0.22,
|
|
"median" : 0.61,
|
|
"max" : 0.75,
|
|
"mean" : 0.55,
|
|
"count" : 150,
|
|
"stdDev" : 0.01
|
|
},
|
|
"physicalMemoryTotalBytes" : 1024,
|
|
"startTimeMs" : 1581508857327,
|
|
"physicalMemoryUsedBytes" : {
|
|
"min" : 1.2,
|
|
"median" : 1.85,
|
|
"max" : 2.5,
|
|
"mean" : 1.77,
|
|
"count" : 155,
|
|
"stdDev" : 0.25
|
|
},
|
|
"endTimeMs" : 1581508867333
|
|
},
|
|
"vpn" : {
|
|
"loss" : 0.1,
|
|
"jitter" : 46,
|
|
"latency" : 150,
|
|
"target" : "54.208.6.220"
|
|
},
|
|
"destination" : {
|
|
"loss" : 0.1,
|
|
"jitter" : 46,
|
|
"latency" : 150,
|
|
"target" : "54.208.6.220"
|
|
},
|
|
"id" : "07625:1490529480:aVDViw0i",
|
|
"roundId" : 1384309800
|
|
}, {
|
|
"date" : "2022-07-17T22:00:54Z",
|
|
"proxy" : {
|
|
"loss" : 0.1,
|
|
"jitter" : 46,
|
|
"latency" : 150,
|
|
"target" : "54.208.6.220"
|
|
},
|
|
"agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
|
|
"systemMetrics" : {
|
|
"cpuUtilization" : {
|
|
"min" : 0.22,
|
|
"median" : 0.61,
|
|
"max" : 0.75,
|
|
"mean" : 0.55,
|
|
"count" : 150,
|
|
"stdDev" : 0.01
|
|
},
|
|
"physicalMemoryTotalBytes" : 1024,
|
|
"startTimeMs" : 1581508857327,
|
|
"physicalMemoryUsedBytes" : {
|
|
"min" : 1.2,
|
|
"median" : 1.85,
|
|
"max" : 2.5,
|
|
"mean" : 1.77,
|
|
"count" : 155,
|
|
"stdDev" : 0.25
|
|
},
|
|
"endTimeMs" : 1581508867333
|
|
},
|
|
"vpn" : {
|
|
"loss" : 0.1,
|
|
"jitter" : 46,
|
|
"latency" : 150,
|
|
"target" : "54.208.6.220"
|
|
},
|
|
"destination" : {
|
|
"loss" : 0.1,
|
|
"jitter" : 46,
|
|
"latency" : 150,
|
|
"target" : "54.208.6.220"
|
|
},
|
|
"id" : "07625:1490529480:aVDViw0i",
|
|
"roundId" : 1384309800
|
|
} ],
|
|
"startDate" : "2022-07-17T22:00:54Z"
|
|
}"""
|
|
|
|
response_loaded_json = json.loads(response_body_json)
|
|
response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestNetworkResults.from_json(response_body_json)
|
|
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
|
|
|
|
def test_filter_real_user_tests_results_models_validation(self) -> None:
|
|
"""Test case for filter_real_user_tests_results request and response models"""
|
|
request_body_json = """
|
|
{
|
|
"searchFilters" : {
|
|
"agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
|
|
"bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
|
|
"visitedSite" : [ "app.thousandeyes.com" ],
|
|
"trigger" : [ "user" ],
|
|
"ssid" : [ "wifi-name", "other-room-wifi" ],
|
|
"platform" : [ "mac", "mac" ],
|
|
"proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
|
|
"destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
|
|
"domain" : [ "thousandeyes.com" ],
|
|
"location" : [ "San Francisco Bay Area", "Germany" ],
|
|
"connection" : [ "wireless", "wireless" ],
|
|
"vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
|
|
"networkId" : [ "660b34109d12", "660b34109d15" ],
|
|
"gateway" : [ "78.153.54.204", "78.153.54.206" ]
|
|
}
|
|
}"""
|
|
|
|
request_loaded_json = json.loads(request_body_json)
|
|
request_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
|
|
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
|
|
|
|
response_body_json = """
|
|
{
|
|
"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"
|
|
}
|
|
},
|
|
"results" : [ {
|
|
"date" : "2022-07-17T22:00:54Z",
|
|
"agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
|
|
"committed" : "2022-07-17T22:00:54Z",
|
|
"experienceScore" : 0.5,
|
|
"sourceAddress" : "84.255.241.1",
|
|
"organizationName" : "T-2 Access Network",
|
|
"visitedSite" : "www.thousandeyes.com",
|
|
"pageId" : "C31gBrYJ",
|
|
"protocol" : "https",
|
|
"numberOfPages" : 2,
|
|
"port" : 443,
|
|
"id" : "07625:1490529480:aVDViw0i",
|
|
"roundId" : 1384309800
|
|
}, {
|
|
"date" : "2022-07-17T22:00:54Z",
|
|
"agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
|
|
"committed" : "2022-07-17T22:00:54Z",
|
|
"experienceScore" : 0.5,
|
|
"sourceAddress" : "84.255.241.1",
|
|
"organizationName" : "T-2 Access Network",
|
|
"visitedSite" : "www.thousandeyes.com",
|
|
"pageId" : "C31gBrYJ",
|
|
"protocol" : "https",
|
|
"numberOfPages" : 2,
|
|
"port" : 443,
|
|
"id" : "07625:1490529480:aVDViw0i",
|
|
"roundId" : 1384309800
|
|
} ],
|
|
"startDate" : "2022-07-17T22:00:54Z"
|
|
}"""
|
|
|
|
response_loaded_json = json.loads(response_body_json)
|
|
response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResults.from_json(response_body_json)
|
|
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
|
|
|
|
def test_filter_real_user_tests_visited_pages_results_models_validation(self) -> None:
|
|
"""Test case for filter_real_user_tests_visited_pages_results request and response models"""
|
|
request_body_json = """
|
|
{
|
|
"agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
|
|
"bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
|
|
"visitedSite" : [ "app.thousandeyes.com" ],
|
|
"trigger" : [ "user" ],
|
|
"ssid" : [ "wifi-name", "other-room-wifi" ],
|
|
"platform" : [ "mac", "mac" ],
|
|
"proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
|
|
"destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
|
|
"domain" : [ "thousandeyes.com" ],
|
|
"location" : [ "San Francisco Bay Area", "Germany" ],
|
|
"connection" : [ "wireless", "wireless" ],
|
|
"vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
|
|
"networkId" : [ "660b34109d12", "660b34109d15" ],
|
|
"gateway" : [ "78.153.54.204", "78.153.54.206" ]
|
|
}"""
|
|
|
|
request_loaded_json = json.loads(request_body_json)
|
|
request_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
|
|
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
|
|
|
|
response_body_json = """
|
|
{
|
|
"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"
|
|
}
|
|
},
|
|
"results" : [ {
|
|
"pageTimings" : {
|
|
"onContentLoad" : 1483,
|
|
"onLoad" : 4569
|
|
},
|
|
"agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
|
|
"systemMetrics" : {
|
|
"cpuUtilization" : {
|
|
"min" : 0.22,
|
|
"median" : 0.61,
|
|
"max" : 0.75,
|
|
"mean" : 0.55,
|
|
"count" : 150,
|
|
"stdDev" : 0.01
|
|
},
|
|
"physicalMemoryTotalBytes" : 1024,
|
|
"startTimeMs" : 1581508857327,
|
|
"physicalMemoryUsedBytes" : {
|
|
"min" : 1.2,
|
|
"median" : 1.85,
|
|
"max" : 2.5,
|
|
"mean" : 1.77,
|
|
"count" : 155,
|
|
"stdDev" : 0.25
|
|
},
|
|
"endTimeMs" : 1581508867333
|
|
},
|
|
"pageTitle" : "Network Performance Resources | ThousandEyes",
|
|
"responseTime" : 240,
|
|
"pageUrl" : "https://app.thousandeyes.com/settings/integrations",
|
|
"id" : "07625:1490529480:aVDViw0i",
|
|
"pageId" : "C31gBrYJ",
|
|
"roundId" : 1384309800,
|
|
"loadDate" : "2022-07-17T22:00:54Z",
|
|
"responseCode" : 200
|
|
}, {
|
|
"pageTimings" : {
|
|
"onContentLoad" : 1483,
|
|
"onLoad" : 4569
|
|
},
|
|
"agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
|
|
"systemMetrics" : {
|
|
"cpuUtilization" : {
|
|
"min" : 0.22,
|
|
"median" : 0.61,
|
|
"max" : 0.75,
|
|
"mean" : 0.55,
|
|
"count" : 150,
|
|
"stdDev" : 0.01
|
|
},
|
|
"physicalMemoryTotalBytes" : 1024,
|
|
"startTimeMs" : 1581508857327,
|
|
"physicalMemoryUsedBytes" : {
|
|
"min" : 1.2,
|
|
"median" : 1.85,
|
|
"max" : 2.5,
|
|
"mean" : 1.77,
|
|
"count" : 155,
|
|
"stdDev" : 0.25
|
|
},
|
|
"endTimeMs" : 1581508867333
|
|
},
|
|
"pageTitle" : "Network Performance Resources | ThousandEyes",
|
|
"responseTime" : 240,
|
|
"pageUrl" : "https://app.thousandeyes.com/settings/integrations",
|
|
"id" : "07625:1490529480:aVDViw0i",
|
|
"pageId" : "C31gBrYJ",
|
|
"roundId" : 1384309800,
|
|
"loadDate" : "2022-07-17T22:00:54Z",
|
|
"responseCode" : 200
|
|
} ],
|
|
"startDate" : "2022-07-17T22:00:54Z"
|
|
}"""
|
|
|
|
response_loaded_json = json.loads(response_body_json)
|
|
response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestPageResults.from_json(response_body_json)
|
|
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
|
|
|
|
def test_get_real_user_test_page_results_models_validation(self) -> None:
|
|
"""Test case for get_real_user_test_page_results request and response models"""
|
|
|
|
response_body_json = """
|
|
{
|
|
"_links" : {
|
|
"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"
|
|
}
|
|
},
|
|
"har" : {
|
|
"log" : {
|
|
"browser" : {
|
|
"name" : "Google Chrome",
|
|
"version" : "7.0.26.98"
|
|
},
|
|
"creator" : {
|
|
"name" : "ThousandEyes Endpoint Agent",
|
|
"version" : "7.0.26"
|
|
},
|
|
"entries" : [ {
|
|
"pageref" : "page_1",
|
|
"request" : {
|
|
"headers" : [ {
|
|
"name" : "Upgrade-Insecure-Requests",
|
|
"value" : "1"
|
|
}, {
|
|
"name" : "User-Agent",
|
|
"value" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36"
|
|
}, {
|
|
"name" : "Accept",
|
|
"value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
|
|
}, {
|
|
"name" : "Referer",
|
|
"value" : "https://www.thousandeyes.com/"
|
|
}, {
|
|
"name" : "Accept-Encoding",
|
|
"value" : "gzip, deflate, sdch, br"
|
|
}, {
|
|
"name" : "Accept-Language",
|
|
"value" : "en-US,en;q=0.6"
|
|
}, {
|
|
"name" : "Cookie",
|
|
"value" : "(removed)"
|
|
} ],
|
|
"method" : "GET",
|
|
"queryString" : [ {
|
|
"name" : "locale",
|
|
"value" : "en-US"
|
|
} ],
|
|
"url" : "https://www.thousandeyes.com/resources"
|
|
},
|
|
"response" : {
|
|
"bodySize" : 17776,
|
|
"content" : {
|
|
"mimeType" : "text/html;charset=ISO-8859-1",
|
|
"size" : 17776
|
|
},
|
|
"headers" : [ {
|
|
"name" : "Content-Type",
|
|
"value" : "text/html;charset=ISO-8859-1"
|
|
}, {
|
|
"name" : "Content-Length",
|
|
"value" : "17776"
|
|
}, {
|
|
"name" : "Connection",
|
|
"value" : "keep-alive"
|
|
}, {
|
|
"name" : "Date",
|
|
"value" : "Sun, 26 Mar 2017 11:58:54 GMT"
|
|
}, {
|
|
"name" : "Server",
|
|
"value" : "Apache"
|
|
}, {
|
|
"name" : "Cache-Control",
|
|
"value" : "max-age=600, must-revalidate"
|
|
}, {
|
|
"name" : "Content-Language",
|
|
"value" : "en-US"
|
|
}, {
|
|
"name" : "Content-Encoding",
|
|
"value" : "gzip"
|
|
}, {
|
|
"name" : "X-Frame-Options",
|
|
"value" : "sameorigin"
|
|
}, {
|
|
"name" : "Strict-Transport-Security",
|
|
"value" : "max-age=31536000"
|
|
}, {
|
|
"name" : "Vary",
|
|
"value" : "Accept-Encoding"
|
|
}, {
|
|
"name" : "X-Cache",
|
|
"value" : "Miss from cloudfront"
|
|
}, {
|
|
"name" : "Via",
|
|
"value" : "1.1 5dbe09af3a2c87121e31ffa67f174f66.cloudfront.net (CloudFront)"
|
|
}, {
|
|
"name" : "X-Amz-Cf-Id",
|
|
"value" : "YkvlkBNKgHt5aMu9vcS22Z8kHn1MUr-8adupwhDk3j9vF-TpSyIxZA=="
|
|
} ],
|
|
"headersSize" : 527,
|
|
"redirectURL" : "",
|
|
"status" : 200,
|
|
"statusText" : "OK"
|
|
},
|
|
"serverIPAddress" : "13.32.22.80",
|
|
"startedDateTime" : "2017-03-22T11:58:54.123+02:00",
|
|
"time" : 177,
|
|
"timings" : {
|
|
"blocked" : -1,
|
|
"connect" : -1,
|
|
"dns" : -1,
|
|
"receive" : 27,
|
|
"send" : -1,
|
|
"ssl" : -1,
|
|
"wait" : 150
|
|
}
|
|
}, {
|
|
"pageref" : "page_1",
|
|
"request" : {
|
|
"headers" : [ {
|
|
"name" : "User-Agent",
|
|
"value" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36"
|
|
}, {
|
|
"name" : "Accept",
|
|
"value" : "*/*"
|
|
}, {
|
|
"name" : "Referer",
|
|
"value" : "https://www.thousandeyes.com/resources"
|
|
}, {
|
|
"name" : "Accept-Encoding",
|
|
"value" : "gzip, deflate, sdch, br"
|
|
}, {
|
|
"name" : "Accept-Language",
|
|
"value" : "en-US,en;q=0.6"
|
|
} ],
|
|
"method" : "GET",
|
|
"queryString" : [ ],
|
|
"url" : "https://use.typekit.net/cjy5myw.js"
|
|
},
|
|
"response" : {
|
|
"bodySize" : 0,
|
|
"content" : {
|
|
"mimeType" : "text/javascript;charset=utf-8",
|
|
"size" : 7814
|
|
},
|
|
"headers" : [ {
|
|
"name" : "status",
|
|
"value" : "200"
|
|
}, {
|
|
"name" : "access-control-allow-origin",
|
|
"value" : "*"
|
|
}, {
|
|
"name" : "cache-control",
|
|
"value" : "public, max-age=600, stale-while-revalidate=604800"
|
|
}, {
|
|
"name" : "content-encoding",
|
|
"value" : "gzip"
|
|
}, {
|
|
"name" : "content-type",
|
|
"value" : "text/javascript;charset=utf-8"
|
|
}, {
|
|
"name" : "server",
|
|
"value" : "nginx"
|
|
}, {
|
|
"name" : "status",
|
|
"value" : "200 OK"
|
|
}, {
|
|
"name" : "timing-allow-origin",
|
|
"value" : "*"
|
|
}, {
|
|
"name" : "vary",
|
|
"value" : "Accept-Encoding"
|
|
}, {
|
|
"name" : "content-length",
|
|
"value" : "7814"
|
|
}, {
|
|
"name" : "date",
|
|
"value" : "Sun, 26 Mar 2017 11:58:43 GMT"
|
|
} ],
|
|
"headersSize" : 334,
|
|
"redirectURL" : "",
|
|
"status" : 200,
|
|
"statusText" : "OK"
|
|
},
|
|
"serverIPAddress" : "104.103.103.234",
|
|
"startedDateTime" : "2017-03-22T11:58:54.123+02:00",
|
|
"time" : 72,
|
|
"timings" : {
|
|
"blocked" : -1,
|
|
"connect" : -1,
|
|
"dns" : -1,
|
|
"receive" : 10,
|
|
"send" : -1,
|
|
"ssl" : -1,
|
|
"wait" : 62
|
|
}
|
|
} ],
|
|
"pages" : [ {
|
|
"id" : "page_1",
|
|
"pageTimings" : {
|
|
"onContentLoad" : 874,
|
|
"onLoad" : 3492
|
|
},
|
|
"responseCode" : 200,
|
|
"startedDateTime" : "2017-03-22T11:58:54.123+02:00",
|
|
"title" : "Network Performance Resources | ThousandEyes"
|
|
} ],
|
|
"version" : "1.2",
|
|
"systemMetrics" : {
|
|
"startTimeMs" : 1581508857327,
|
|
"endTimeMs" : 1581508867333,
|
|
"cpuUtilization" : {
|
|
"min" : 0.30859375,
|
|
"max" : 0.5625,
|
|
"mean" : 0.38931831001805056,
|
|
"median" : 0.353515625,
|
|
"stdDev" : 0.08389194281742307,
|
|
"count" : 10
|
|
},
|
|
"physicalMemoryUsedBytes" : {
|
|
"min" : 1.2805128192E10,
|
|
"max" : 1.2825530368E10,
|
|
"mean" : 1.281914582109091E10,
|
|
"median" : 1.2818219008E10,
|
|
"stdDev" : 5741124.05691331,
|
|
"count" : 11
|
|
},
|
|
"physicalMemoryTotalBytes" : 17069891584
|
|
}
|
|
}
|
|
}
|
|
}"""
|
|
|
|
response_loaded_json = json.loads(response_body_json)
|
|
response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestPageDetailResult.from_json(response_body_json)
|
|
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
|
|
|
|
def test_get_real_user_test_results_models_validation(self) -> None:
|
|
"""Test case for get_real_user_test_results request and response models"""
|
|
|
|
response_body_json = """
|
|
{
|
|
"_links" : {
|
|
"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",
|
|
"agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
|
|
"committed" : "2022-07-17T22:00:54Z",
|
|
"experienceScore" : 0.5,
|
|
"sourceAddress" : "84.255.241.1",
|
|
"organizationName" : "T-2 Access Network",
|
|
"visitedSite" : "www.thousandeyes.com",
|
|
"coordinates" : {
|
|
"latitude" : 46.0552778,
|
|
"location" : "Slovenia",
|
|
"longitude" : 14.5144444
|
|
},
|
|
"network" : {
|
|
"systemMetrics" : {
|
|
"cpuUtilization" : {
|
|
"min" : 0.22,
|
|
"median" : 0.61,
|
|
"max" : 0.75,
|
|
"mean" : 0.55,
|
|
"count" : 150,
|
|
"stdDev" : 0.01
|
|
},
|
|
"physicalMemoryTotalBytes" : 1024,
|
|
"startTimeMs" : 1581508857327,
|
|
"physicalMemoryUsedBytes" : {
|
|
"min" : 1.2,
|
|
"median" : 1.85,
|
|
"max" : 2.5,
|
|
"mean" : 1.77,
|
|
"count" : 155,
|
|
"stdDev" : 0.25
|
|
},
|
|
"endTimeMs" : 1581508867333
|
|
},
|
|
"isIcmpBlocked" : true,
|
|
"vpnPing" : {
|
|
"maxRtt" : 66,
|
|
"pktsReceived" : 10,
|
|
"avgRtt" : 7,
|
|
"meanDevRtt" : 11,
|
|
"minRtt" : 1,
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"pktsSent" : 10
|
|
},
|
|
"ping" : {
|
|
"maxRtt" : 66,
|
|
"pktsReceived" : 10,
|
|
"avgRtt" : 7,
|
|
"meanDevRtt" : 11,
|
|
"minRtt" : 1,
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"pktsSent" : 10
|
|
},
|
|
"networkProfile" : {
|
|
"previousInterface" : {
|
|
"publicIpAddress" : "84.255.241.1",
|
|
"publicIpRange" : "84.255.241.0-84.255.241.255",
|
|
"ipAddress" : "10.0.0.13",
|
|
"hardwareType" : "wireless",
|
|
"localPrefix" : "10.0.0.0",
|
|
"interfaceName" : "en0",
|
|
"subnetMask" : "255.255.255.0",
|
|
"dnsServers" : [ "8.8.8.8", "8.8.8.4" ]
|
|
},
|
|
"ethernetProfile" : {
|
|
"linkSpeed" : 860
|
|
},
|
|
"publicIpAddress" : "84.255.241.1",
|
|
"publicIpRange" : "84.255.241.0-84.255.241.255",
|
|
"ipAddress" : "10.0.0.13",
|
|
"hardwareType" : "wireless",
|
|
"localPrefix" : "10.0.0.0",
|
|
"proxyProfile" : {
|
|
"method" : "System",
|
|
"proxies" : [ {
|
|
"bypass" : "*.local;169.254/16",
|
|
"proxy" : "<direct>"
|
|
}, {
|
|
"bypass" : "*.local;169.254/16",
|
|
"proxy" : "<direct>"
|
|
} ]
|
|
},
|
|
"subnetMask" : "255.255.255.0",
|
|
"error" : "An operation timed out.",
|
|
"wirelessProfile" : {
|
|
"rssi" : -38,
|
|
"bssid" : "4c:ba:ba:f4:fa:fa",
|
|
"vendor" : "Cisco",
|
|
"txRate" : 130,
|
|
"channel" : 1,
|
|
"noise" : -95,
|
|
"phyMode" : "802.11n",
|
|
"ssid" : "Internet for the masses",
|
|
"quality" : 100
|
|
},
|
|
"interfaceName" : "en0",
|
|
"dnsServers" : [ "8.8.8.8", "8.8.8.4" ],
|
|
"gateway" : "10.0.0.1"
|
|
},
|
|
"traceroute" : {
|
|
"destination" : "13.32.22.232",
|
|
"hops" : [ {
|
|
"delay" : 5,
|
|
"prefix" : "196.40.96.0/20",
|
|
"hop" : 1,
|
|
"ipAddress" : "196.40.106.237",
|
|
"name" : "89-210-88-65.access.t-2.net",
|
|
"mpls" : [ "L=301472,E=0,S=1,T=1" ],
|
|
"asn" : 34779
|
|
}, {
|
|
"delay" : 5,
|
|
"prefix" : "196.40.96.0/20",
|
|
"hop" : 1,
|
|
"ipAddress" : "196.40.106.237",
|
|
"name" : "89-210-88-65.access.t-2.net",
|
|
"mpls" : [ "L=301472,E=0,S=1,T=1" ],
|
|
"asn" : 34779
|
|
} ],
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ]
|
|
},
|
|
"vpnTraceroute" : {
|
|
"destination" : "13.32.22.232",
|
|
"hops" : [ {
|
|
"delay" : 5,
|
|
"prefix" : "196.40.96.0/20",
|
|
"hop" : 1,
|
|
"ipAddress" : "196.40.106.237",
|
|
"name" : "89-210-88-65.access.t-2.net",
|
|
"mpls" : [ "L=301472,E=0,S=1,T=1" ],
|
|
"asn" : 34779
|
|
}, {
|
|
"delay" : 5,
|
|
"prefix" : "196.40.96.0/20",
|
|
"hop" : 1,
|
|
"ipAddress" : "196.40.106.237",
|
|
"name" : "89-210-88-65.access.t-2.net",
|
|
"mpls" : [ "L=301472,E=0,S=1,T=1" ],
|
|
"asn" : 34779
|
|
} ],
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ]
|
|
},
|
|
"connectRtt" : 77.777,
|
|
"gatewayPing" : {
|
|
"maxRtt" : 66,
|
|
"pktsReceived" : 10,
|
|
"avgRtt" : 7,
|
|
"meanDevRtt" : 11,
|
|
"minRtt" : 1,
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"pktsSent" : 10
|
|
},
|
|
"errors" : [ "ping: Request timed out before getting response" ]
|
|
},
|
|
"protocol" : "https",
|
|
"pages" : [ {
|
|
"pageTimings" : {
|
|
"onContentLoad" : 1483,
|
|
"onLoad" : 4569
|
|
},
|
|
"pageTitle" : "Network Performance Resources | ThousandEyes",
|
|
"pageUrl" : "https://app.thousandeyes.com/settings/integrations",
|
|
"pageId" : "C31gBrYJ",
|
|
"loadDate" : "2022-07-17T22:00:54Z",
|
|
"responseCode" : 200
|
|
}, {
|
|
"pageTimings" : {
|
|
"onContentLoad" : 1483,
|
|
"onLoad" : 4569
|
|
},
|
|
"pageTitle" : "Network Performance Resources | ThousandEyes",
|
|
"pageUrl" : "https://app.thousandeyes.com/settings/integrations",
|
|
"pageId" : "C31gBrYJ",
|
|
"loadDate" : "2022-07-17T22:00:54Z",
|
|
"responseCode" : 200
|
|
} ],
|
|
"numberOfPages" : 2,
|
|
"port" : 443,
|
|
"browser" : {
|
|
"name" : "Google Chrome",
|
|
"version" : "116.0.0.0"
|
|
},
|
|
"id" : "07625:1490529480:aVDViw0i",
|
|
"roundId" : 1384309800
|
|
}, {
|
|
"date" : "2022-07-17T22:00:54Z",
|
|
"agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
|
|
"committed" : "2022-07-17T22:00:54Z",
|
|
"experienceScore" : 0.5,
|
|
"sourceAddress" : "84.255.241.1",
|
|
"organizationName" : "T-2 Access Network",
|
|
"visitedSite" : "www.thousandeyes.com",
|
|
"coordinates" : {
|
|
"latitude" : 46.0552778,
|
|
"location" : "Slovenia",
|
|
"longitude" : 14.5144444
|
|
},
|
|
"network" : {
|
|
"systemMetrics" : {
|
|
"cpuUtilization" : {
|
|
"min" : 0.22,
|
|
"median" : 0.61,
|
|
"max" : 0.75,
|
|
"mean" : 0.55,
|
|
"count" : 150,
|
|
"stdDev" : 0.01
|
|
},
|
|
"physicalMemoryTotalBytes" : 1024,
|
|
"startTimeMs" : 1581508857327,
|
|
"physicalMemoryUsedBytes" : {
|
|
"min" : 1.2,
|
|
"median" : 1.85,
|
|
"max" : 2.5,
|
|
"mean" : 1.77,
|
|
"count" : 155,
|
|
"stdDev" : 0.25
|
|
},
|
|
"endTimeMs" : 1581508867333
|
|
},
|
|
"isIcmpBlocked" : true,
|
|
"vpnPing" : {
|
|
"maxRtt" : 66,
|
|
"pktsReceived" : 10,
|
|
"avgRtt" : 7,
|
|
"meanDevRtt" : 11,
|
|
"minRtt" : 1,
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"pktsSent" : 10
|
|
},
|
|
"ping" : {
|
|
"maxRtt" : 66,
|
|
"pktsReceived" : 10,
|
|
"avgRtt" : 7,
|
|
"meanDevRtt" : 11,
|
|
"minRtt" : 1,
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"pktsSent" : 10
|
|
},
|
|
"networkProfile" : {
|
|
"previousInterface" : {
|
|
"publicIpAddress" : "84.255.241.1",
|
|
"publicIpRange" : "84.255.241.0-84.255.241.255",
|
|
"ipAddress" : "10.0.0.13",
|
|
"hardwareType" : "wireless",
|
|
"localPrefix" : "10.0.0.0",
|
|
"interfaceName" : "en0",
|
|
"subnetMask" : "255.255.255.0",
|
|
"dnsServers" : [ "8.8.8.8", "8.8.8.4" ]
|
|
},
|
|
"ethernetProfile" : {
|
|
"linkSpeed" : 860
|
|
},
|
|
"publicIpAddress" : "84.255.241.1",
|
|
"publicIpRange" : "84.255.241.0-84.255.241.255",
|
|
"ipAddress" : "10.0.0.13",
|
|
"hardwareType" : "wireless",
|
|
"localPrefix" : "10.0.0.0",
|
|
"proxyProfile" : {
|
|
"method" : "System",
|
|
"proxies" : [ {
|
|
"bypass" : "*.local;169.254/16",
|
|
"proxy" : "<direct>"
|
|
}, {
|
|
"bypass" : "*.local;169.254/16",
|
|
"proxy" : "<direct>"
|
|
} ]
|
|
},
|
|
"subnetMask" : "255.255.255.0",
|
|
"error" : "An operation timed out.",
|
|
"wirelessProfile" : {
|
|
"rssi" : -38,
|
|
"bssid" : "4c:ba:ba:f4:fa:fa",
|
|
"vendor" : "Cisco",
|
|
"txRate" : 130,
|
|
"channel" : 1,
|
|
"noise" : -95,
|
|
"phyMode" : "802.11n",
|
|
"ssid" : "Internet for the masses",
|
|
"quality" : 100
|
|
},
|
|
"interfaceName" : "en0",
|
|
"dnsServers" : [ "8.8.8.8", "8.8.8.4" ],
|
|
"gateway" : "10.0.0.1"
|
|
},
|
|
"traceroute" : {
|
|
"destination" : "13.32.22.232",
|
|
"hops" : [ {
|
|
"delay" : 5,
|
|
"prefix" : "196.40.96.0/20",
|
|
"hop" : 1,
|
|
"ipAddress" : "196.40.106.237",
|
|
"name" : "89-210-88-65.access.t-2.net",
|
|
"mpls" : [ "L=301472,E=0,S=1,T=1" ],
|
|
"asn" : 34779
|
|
}, {
|
|
"delay" : 5,
|
|
"prefix" : "196.40.96.0/20",
|
|
"hop" : 1,
|
|
"ipAddress" : "196.40.106.237",
|
|
"name" : "89-210-88-65.access.t-2.net",
|
|
"mpls" : [ "L=301472,E=0,S=1,T=1" ],
|
|
"asn" : 34779
|
|
} ],
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ]
|
|
},
|
|
"vpnTraceroute" : {
|
|
"destination" : "13.32.22.232",
|
|
"hops" : [ {
|
|
"delay" : 5,
|
|
"prefix" : "196.40.96.0/20",
|
|
"hop" : 1,
|
|
"ipAddress" : "196.40.106.237",
|
|
"name" : "89-210-88-65.access.t-2.net",
|
|
"mpls" : [ "L=301472,E=0,S=1,T=1" ],
|
|
"asn" : 34779
|
|
}, {
|
|
"delay" : 5,
|
|
"prefix" : "196.40.96.0/20",
|
|
"hop" : 1,
|
|
"ipAddress" : "196.40.106.237",
|
|
"name" : "89-210-88-65.access.t-2.net",
|
|
"mpls" : [ "L=301472,E=0,S=1,T=1" ],
|
|
"asn" : 34779
|
|
} ],
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ]
|
|
},
|
|
"connectRtt" : 77.777,
|
|
"gatewayPing" : {
|
|
"maxRtt" : 66,
|
|
"pktsReceived" : 10,
|
|
"avgRtt" : 7,
|
|
"meanDevRtt" : 11,
|
|
"minRtt" : 1,
|
|
"error" : "An operation timed out.",
|
|
"infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
|
|
"pktsSent" : 10
|
|
},
|
|
"errors" : [ "ping: Request timed out before getting response" ]
|
|
},
|
|
"protocol" : "https",
|
|
"pages" : [ {
|
|
"pageTimings" : {
|
|
"onContentLoad" : 1483,
|
|
"onLoad" : 4569
|
|
},
|
|
"pageTitle" : "Network Performance Resources | ThousandEyes",
|
|
"pageUrl" : "https://app.thousandeyes.com/settings/integrations",
|
|
"pageId" : "C31gBrYJ",
|
|
"loadDate" : "2022-07-17T22:00:54Z",
|
|
"responseCode" : 200
|
|
}, {
|
|
"pageTimings" : {
|
|
"onContentLoad" : 1483,
|
|
"onLoad" : 4569
|
|
},
|
|
"pageTitle" : "Network Performance Resources | ThousandEyes",
|
|
"pageUrl" : "https://app.thousandeyes.com/settings/integrations",
|
|
"pageId" : "C31gBrYJ",
|
|
"loadDate" : "2022-07-17T22:00:54Z",
|
|
"responseCode" : 200
|
|
} ],
|
|
"numberOfPages" : 2,
|
|
"port" : 443,
|
|
"browser" : {
|
|
"name" : "Google Chrome",
|
|
"version" : "116.0.0.0"
|
|
},
|
|
"id" : "07625:1490529480:aVDViw0i",
|
|
"roundId" : 1384309800
|
|
} ]
|
|
}"""
|
|
|
|
response_loaded_json = json.loads(response_body_json)
|
|
response_from_json = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestDetailResults.from_json(response_body_json)
|
|
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|