thousandeyes-sdk-python/thousandeyes-sdk-test-results/test/test_web_transactions_test_results_api_integration.py
Kevin 5441f44f1f CP-2453 Add generated integration tests for all SDK packages
Sync OAS-driven integration test artifacts (mock manifest, test base, conftest, and per-operation integration tests) across 21 packages for CP-2453 full rollout evaluation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-28 12:07:00 +01:00

1651 lines
80 KiB
Python

# coding: utf-8
"""
Test Results API
Get test result metrics for Network and Application Synthetics 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 thousandeyes_sdk.core.exceptions import ApiException
from thousandeyes_sdk.test_results.api.web_transactions_test_results_api import WebTransactionsTestResultsApi
from .integration_test_utils import IntegrationTestBase
from .test_utils import assert_constructed_model_matches_example_json
class TestWebTransactionsTestResultsApiIntegration(IntegrationTestBase):
"""WebTransactionsTestResultsApi integration test stubs"""
def setUp(self) -> None:
super().setUp()
self.api = WebTransactionsTestResultsApi(self.api_client)
def test_get_test_web_transaction_agent_round_page_results_happy_path(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_page_results success path"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
page_id = '281474976710706'
aid = '1234'
response_body_json = """
{
&quot;test&quot; : {
&quot;_links&quot; : {
&quot;testResults&quot; : [ {
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/test-results/281474976710706/network&quot;
}, {
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis&quot;
} ],
&quot;self&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;liveShare&quot; : false,
&quot;savedEvent&quot; : true,
&quot;description&quot; : &quot;ThousandEyes Test&quot;,
&quot;type&quot; : &quot;agent-to-server&quot;,
&quot;enabled&quot; : true,
&quot;createdDate&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;createdBy&quot; : &quot;user@user.com&quot;,
&quot;modifiedDate&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;interval&quot; : 60,
&quot;modifiedBy&quot; : &quot;user@user.com&quot;,
&quot;testId&quot; : &quot;281474976710706&quot;,
&quot;alertsEnabled&quot; : true,
&quot;testName&quot; : &quot;ThousandEyes Test&quot;
},
&quot;_links&quot; : {
&quot;next&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
},
&quot;previous&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
},
&quot;self&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;results&quot; : [ {
&quot;date&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;agent&quot; : {
&quot;agentId&quot; : &quot;281474976710706&quot;,
&quot;agentName&quot; : &quot;thousandeyes-stg-va-254&quot;,
&quot;location&quot; : &quot;San Francisco Bay Area&quot;,
&quot;countryId&quot; : &quot;US&quot;
},
&quot;_links&quot; : {
&quot;appLink&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;componentErrors&quot; : 5,
&quot;errorType&quot; : &quot;None&quot;,
&quot;transactionTime&quot; : 2379,
&quot;pages&quot; : [ {
&quot;duration&quot; : 1117.5660001039505,
&quot;componentCount&quot; : 136,
&quot;pageNum&quot; : 0,
&quot;pageName&quot; : &quot;Google&quot;,
&quot;errorCount&quot; : 0
}, {
&quot;duration&quot; : 1117.5660001039505,
&quot;componentCount&quot; : 136,
&quot;pageNum&quot; : 0,
&quot;pageName&quot; : &quot;Google&quot;,
&quot;errorCount&quot; : 0
} ],
&quot;har&quot; : {
&quot;log&quot; : {
&quot;creator&quot; : {
&quot;name&quot; : &quot;ThousandEyes DB Exporter&quot;
},
&quot;entries&quot; : [ {
&quot;pageref&quot; : &quot;page_0&quot;,
&quot;request&quot; : {
&quot;headers&quot; : [ {
&quot;name&quot; : &quot;:authority&quot;,
&quot;value&quot; : &quot;google.com&quot;
}, {
&quot;name&quot; : &quot;:method&quot;,
&quot;value&quot; : &quot;GET&quot;
}, {
&quot;name&quot; : &quot;:path&quot;,
&quot;value&quot; : &quot;/&quot;
}, {
&quot;name&quot; : &quot;:scheme&quot;,
&quot;value&quot; : &quot;https&quot;
}, {
&quot;name&quot; : &quot;accept&quot;,
&quot;value&quot; : &quot;text/html,application/xhtml+xml,application/xml;q&#x3D;0.9,image/webp,image/apng,*/*;q&#x3D;0.8&quot;
}, {
&quot;name&quot; : &quot;accept-encoding&quot;,
&quot;value&quot; : &quot;gzip, deflate, br&quot;
}, {
&quot;name&quot; : &quot;accept-language&quot;,
&quot;value&quot; : &quot;en-US,en;q&#x3D;0.9&quot;
}, {
&quot;name&quot; : &quot;upgrade-insecure-requests&quot;,
&quot;value&quot; : &quot;1&quot;
}, {
&quot;name&quot; : &quot;user-agent&quot;,
&quot;value&quot; : &quot;Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36&quot;
}, {
&quot;name&quot; : &quot;x-thousandeyes-agent&quot;,
&quot;value&quot; : &quot;yes&quot;
} ],
&quot;method&quot; : &quot;GET&quot;,
&quot;url&quot; : &quot;https://google.com/&quot;
},
&quot;response&quot; : {
&quot;bodySize&quot; : 220,
&quot;content&quot; : {
&quot;mimeType&quot; : &quot;text/html&quot;,
&quot;size&quot; : 220
},
&quot;headers&quot; : [ {
&quot;name&quot; : &quot;alt-svc&quot;,
&quot;value&quot; : &quot;quic&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000; v&#x3D;\&quot;46,43\&quot;,h3-Q050&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q049&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q048&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q046&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q043&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000&quot;
}, {
&quot;name&quot; : &quot;cache-control&quot;,
&quot;value&quot; : &quot;public, max-age&#x3D;2592000&quot;
}, {
&quot;name&quot; : &quot;content-length&quot;,
&quot;value&quot; : &quot;220&quot;
}, {
&quot;name&quot; : &quot;content-type&quot;,
&quot;value&quot; : &quot;text/html; charset&#x3D;UTF-8&quot;
}, {
&quot;name&quot; : &quot;date&quot;,
&quot;value&quot; : &quot;Fri, 15 Nov 2019 16:41:54 GMT&quot;
}, {
&quot;name&quot; : &quot;expires&quot;,
&quot;value&quot; : &quot;Sun, 15 Dec 2019 16:41:54 GMT&quot;
}, {
&quot;name&quot; : &quot;location&quot;,
&quot;value&quot; : &quot;https://www.google.com/&quot;
}, {
&quot;name&quot; : &quot;server&quot;,
&quot;value&quot; : &quot;gws&quot;
}, {
&quot;name&quot; : &quot;status&quot;,
&quot;value&quot; : &quot;301&quot;
}, {
&quot;name&quot; : &quot;x-frame-options&quot;,
&quot;value&quot; : &quot;SAMEORIGIN&quot;
}, {
&quot;name&quot; : &quot;x-xss-protection&quot;,
&quot;value&quot; : &quot;0&quot;
} ],
&quot;headersSize&quot; : 471,
&quot;redirectURL&quot; : &quot;&quot;,
&quot;status&quot; : 301,
&quot;statusText&quot; : &quot;MOVED_PERMANENTLY&quot;
},
&quot;serverIPAddress&quot; : &quot;172.217.6.110&quot;,
&quot;startedDateTime&quot; : &quot;2019-11-15T16:41:54.798Z&quot;,
&quot;time&quot; : 71,
&quot;timings&quot; : {
&quot;blocked&quot; : 2,
&quot;connect&quot; : 16,
&quot;dns&quot; : 1,
&quot;receive&quot; : 1,
&quot;send&quot; : 0,
&quot;ssl&quot; : 14,
&quot;wait&quot; : 50
}
}, {
&quot;pageref&quot; : &quot;page_0&quot;,
&quot;request&quot; : {
&quot;headers&quot; : [ {
&quot;name&quot; : &quot;:authority&quot;,
&quot;value&quot; : &quot;www.google.com&quot;
}, {
&quot;name&quot; : &quot;:method&quot;,
&quot;value&quot; : &quot;GET&quot;
}, {
&quot;name&quot; : &quot;:path&quot;,
&quot;value&quot; : &quot;/&quot;
}, {
&quot;name&quot; : &quot;:scheme&quot;,
&quot;value&quot; : &quot;https&quot;
}, {
&quot;name&quot; : &quot;accept&quot;,
&quot;value&quot; : &quot;text/html,application/xhtml+xml,application/xml;q&#x3D;0.9,image/webp,image/apng,*/*;q&#x3D;0.8&quot;
}, {
&quot;name&quot; : &quot;accept-encoding&quot;,
&quot;value&quot; : &quot;gzip, deflate, br&quot;
}, {
&quot;name&quot; : &quot;accept-language&quot;,
&quot;value&quot; : &quot;en-US,en;q&#x3D;0.9&quot;
}, {
&quot;name&quot; : &quot;upgrade-insecure-requests&quot;,
&quot;value&quot; : &quot;1&quot;
}, {
&quot;name&quot; : &quot;user-agent&quot;,
&quot;value&quot; : &quot;Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36&quot;
}, {
&quot;name&quot; : &quot;x-thousandeyes-agent&quot;,
&quot;value&quot; : &quot;yes&quot;
} ],
&quot;method&quot; : &quot;GET&quot;,
&quot;url&quot; : &quot;https://www.google.com/&quot;
},
&quot;response&quot; : {
&quot;bodySize&quot; : 65214,
&quot;content&quot; : {
&quot;mimeType&quot; : &quot;text/html&quot;,
&quot;size&quot; : 225039
},
&quot;headers&quot; : [ {
&quot;name&quot; : &quot;alt-svc&quot;,
&quot;value&quot; : &quot;quic&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000; v&#x3D;\&quot;46,43\&quot;,h3-Q050&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q049&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q048&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q046&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q043&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000&quot;
}, {
&quot;name&quot; : &quot;cache-control&quot;,
&quot;value&quot; : &quot;private, max-age&#x3D;0&quot;
}, {
&quot;name&quot; : &quot;content-encoding&quot;,
&quot;value&quot; : &quot;br&quot;
}, {
&quot;name&quot; : &quot;content-length&quot;,
&quot;value&quot; : &quot;65214&quot;
}, {
&quot;name&quot; : &quot;content-type&quot;,
&quot;value&quot; : &quot;text/html; charset&#x3D;UTF-8&quot;
}, {
&quot;name&quot; : &quot;date&quot;,
&quot;value&quot; : &quot;Fri, 15 Nov 2019 16:41:54 GMT&quot;
}, {
&quot;name&quot; : &quot;expires&quot;,
&quot;value&quot; : &quot;-1&quot;
}, {
&quot;name&quot; : &quot;p3p&quot;,
&quot;value&quot; : &quot;CP&#x3D;\&quot;This is not a P3P policy! See g.co/p3phelp for more info.\&quot;&quot;
}, {
&quot;name&quot; : &quot;server&quot;,
&quot;value&quot; : &quot;gws&quot;
}, {
&quot;name&quot; : &quot;set-cookie&quot;,
&quot;value&quot; : &quot;(removed)&quot;
}, {
&quot;name&quot; : &quot;status&quot;,
&quot;value&quot; : &quot;200&quot;
}, {
&quot;name&quot; : &quot;strict-transport-security&quot;,
&quot;value&quot; : &quot;max-age&#x3D;31536000&quot;
}, {
&quot;name&quot; : &quot;x-frame-options&quot;,
&quot;value&quot; : &quot;SAMEORIGIN&quot;
}, {
&quot;name&quot; : &quot;x-xss-protection&quot;,
&quot;value&quot; : &quot;0&quot;
} ],
&quot;headersSize&quot; : 915,
&quot;redirectURL&quot; : &quot;&quot;,
&quot;status&quot; : 200,
&quot;statusText&quot; : &quot;OK&quot;
},
&quot;serverIPAddress&quot; : &quot;172.217.4.196&quot;,
&quot;startedDateTime&quot; : &quot;2019-11-15T16:41:54.870Z&quot;,
&quot;time&quot; : 182,
&quot;timings&quot; : {
&quot;blocked&quot; : 2,
&quot;connect&quot; : 4,
&quot;dns&quot; : 0,
&quot;receive&quot; : 58,
&quot;send&quot; : 0,
&quot;ssl&quot; : 2,
&quot;wait&quot; : 118
}
} ],
&quot;pages&quot; : [ {
&quot;id&quot; : &quot;page_0&quot;,
&quot;pageTimings&quot; : {
&quot;onContentLoad&quot; : 367,
&quot;onLoad&quot; : 737
},
&quot;responseCode&quot; : 0,
&quot;startedDateTime&quot; : &quot;2019-11-15T16:41:54.796Z&quot;,
&quot;title&quot; : &quot;Google&quot;
} ],
&quot;version&quot; : &quot;1.2&quot;
}
},
&quot;startTime&quot; : 1384309800,
&quot;endTime&quot; : 1384309800,
&quot;markers&quot; : [ {
&quot;duration&quot; : 1360,
&quot;name&quot; : &quot;SearchForWebdriver&quot;
}, {
&quot;duration&quot; : 1360,
&quot;name&quot; : &quot;SearchForWebdriver&quot;
} ],
&quot;roundId&quot; : 1384309800,
&quot;errorDetails&quot; : &quot;Connection error&quot;
}, {
&quot;date&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;agent&quot; : {
&quot;agentId&quot; : &quot;281474976710706&quot;,
&quot;agentName&quot; : &quot;thousandeyes-stg-va-254&quot;,
&quot;location&quot; : &quot;San Francisco Bay Area&quot;,
&quot;countryId&quot; : &quot;US&quot;
},
&quot;_links&quot; : {
&quot;appLink&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;componentErrors&quot; : 5,
&quot;errorType&quot; : &quot;None&quot;,
&quot;transactionTime&quot; : 2379,
&quot;pages&quot; : [ {
&quot;duration&quot; : 1117.5660001039505,
&quot;componentCount&quot; : 136,
&quot;pageNum&quot; : 0,
&quot;pageName&quot; : &quot;Google&quot;,
&quot;errorCount&quot; : 0
}, {
&quot;duration&quot; : 1117.5660001039505,
&quot;componentCount&quot; : 136,
&quot;pageNum&quot; : 0,
&quot;pageName&quot; : &quot;Google&quot;,
&quot;errorCount&quot; : 0
} ],
&quot;har&quot; : {
&quot;log&quot; : {
&quot;creator&quot; : {
&quot;name&quot; : &quot;ThousandEyes DB Exporter&quot;
},
&quot;entries&quot; : [ {
&quot;pageref&quot; : &quot;page_0&quot;,
&quot;request&quot; : {
&quot;headers&quot; : [ {
&quot;name&quot; : &quot;:authority&quot;,
&quot;value&quot; : &quot;google.com&quot;
}, {
&quot;name&quot; : &quot;:method&quot;,
&quot;value&quot; : &quot;GET&quot;
}, {
&quot;name&quot; : &quot;:path&quot;,
&quot;value&quot; : &quot;/&quot;
}, {
&quot;name&quot; : &quot;:scheme&quot;,
&quot;value&quot; : &quot;https&quot;
}, {
&quot;name&quot; : &quot;accept&quot;,
&quot;value&quot; : &quot;text/html,application/xhtml+xml,application/xml;q&#x3D;0.9,image/webp,image/apng,*/*;q&#x3D;0.8&quot;
}, {
&quot;name&quot; : &quot;accept-encoding&quot;,
&quot;value&quot; : &quot;gzip, deflate, br&quot;
}, {
&quot;name&quot; : &quot;accept-language&quot;,
&quot;value&quot; : &quot;en-US,en;q&#x3D;0.9&quot;
}, {
&quot;name&quot; : &quot;upgrade-insecure-requests&quot;,
&quot;value&quot; : &quot;1&quot;
}, {
&quot;name&quot; : &quot;user-agent&quot;,
&quot;value&quot; : &quot;Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36&quot;
}, {
&quot;name&quot; : &quot;x-thousandeyes-agent&quot;,
&quot;value&quot; : &quot;yes&quot;
} ],
&quot;method&quot; : &quot;GET&quot;,
&quot;url&quot; : &quot;https://google.com/&quot;
},
&quot;response&quot; : {
&quot;bodySize&quot; : 220,
&quot;content&quot; : {
&quot;mimeType&quot; : &quot;text/html&quot;,
&quot;size&quot; : 220
},
&quot;headers&quot; : [ {
&quot;name&quot; : &quot;alt-svc&quot;,
&quot;value&quot; : &quot;quic&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000; v&#x3D;\&quot;46,43\&quot;,h3-Q050&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q049&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q048&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q046&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q043&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000&quot;
}, {
&quot;name&quot; : &quot;cache-control&quot;,
&quot;value&quot; : &quot;public, max-age&#x3D;2592000&quot;
}, {
&quot;name&quot; : &quot;content-length&quot;,
&quot;value&quot; : &quot;220&quot;
}, {
&quot;name&quot; : &quot;content-type&quot;,
&quot;value&quot; : &quot;text/html; charset&#x3D;UTF-8&quot;
}, {
&quot;name&quot; : &quot;date&quot;,
&quot;value&quot; : &quot;Fri, 15 Nov 2019 16:41:54 GMT&quot;
}, {
&quot;name&quot; : &quot;expires&quot;,
&quot;value&quot; : &quot;Sun, 15 Dec 2019 16:41:54 GMT&quot;
}, {
&quot;name&quot; : &quot;location&quot;,
&quot;value&quot; : &quot;https://www.google.com/&quot;
}, {
&quot;name&quot; : &quot;server&quot;,
&quot;value&quot; : &quot;gws&quot;
}, {
&quot;name&quot; : &quot;status&quot;,
&quot;value&quot; : &quot;301&quot;
}, {
&quot;name&quot; : &quot;x-frame-options&quot;,
&quot;value&quot; : &quot;SAMEORIGIN&quot;
}, {
&quot;name&quot; : &quot;x-xss-protection&quot;,
&quot;value&quot; : &quot;0&quot;
} ],
&quot;headersSize&quot; : 471,
&quot;redirectURL&quot; : &quot;&quot;,
&quot;status&quot; : 301,
&quot;statusText&quot; : &quot;MOVED_PERMANENTLY&quot;
},
&quot;serverIPAddress&quot; : &quot;172.217.6.110&quot;,
&quot;startedDateTime&quot; : &quot;2019-11-15T16:41:54.798Z&quot;,
&quot;time&quot; : 71,
&quot;timings&quot; : {
&quot;blocked&quot; : 2,
&quot;connect&quot; : 16,
&quot;dns&quot; : 1,
&quot;receive&quot; : 1,
&quot;send&quot; : 0,
&quot;ssl&quot; : 14,
&quot;wait&quot; : 50
}
}, {
&quot;pageref&quot; : &quot;page_0&quot;,
&quot;request&quot; : {
&quot;headers&quot; : [ {
&quot;name&quot; : &quot;:authority&quot;,
&quot;value&quot; : &quot;www.google.com&quot;
}, {
&quot;name&quot; : &quot;:method&quot;,
&quot;value&quot; : &quot;GET&quot;
}, {
&quot;name&quot; : &quot;:path&quot;,
&quot;value&quot; : &quot;/&quot;
}, {
&quot;name&quot; : &quot;:scheme&quot;,
&quot;value&quot; : &quot;https&quot;
}, {
&quot;name&quot; : &quot;accept&quot;,
&quot;value&quot; : &quot;text/html,application/xhtml+xml,application/xml;q&#x3D;0.9,image/webp,image/apng,*/*;q&#x3D;0.8&quot;
}, {
&quot;name&quot; : &quot;accept-encoding&quot;,
&quot;value&quot; : &quot;gzip, deflate, br&quot;
}, {
&quot;name&quot; : &quot;accept-language&quot;,
&quot;value&quot; : &quot;en-US,en;q&#x3D;0.9&quot;
}, {
&quot;name&quot; : &quot;upgrade-insecure-requests&quot;,
&quot;value&quot; : &quot;1&quot;
}, {
&quot;name&quot; : &quot;user-agent&quot;,
&quot;value&quot; : &quot;Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.83 Safari/537.36&quot;
}, {
&quot;name&quot; : &quot;x-thousandeyes-agent&quot;,
&quot;value&quot; : &quot;yes&quot;
} ],
&quot;method&quot; : &quot;GET&quot;,
&quot;url&quot; : &quot;https://www.google.com/&quot;
},
&quot;response&quot; : {
&quot;bodySize&quot; : 65214,
&quot;content&quot; : {
&quot;mimeType&quot; : &quot;text/html&quot;,
&quot;size&quot; : 225039
},
&quot;headers&quot; : [ {
&quot;name&quot; : &quot;alt-svc&quot;,
&quot;value&quot; : &quot;quic&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000; v&#x3D;\&quot;46,43\&quot;,h3-Q050&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q049&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q048&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q046&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000,h3-Q043&#x3D;\&quot;:443\&quot;; ma&#x3D;2592000&quot;
}, {
&quot;name&quot; : &quot;cache-control&quot;,
&quot;value&quot; : &quot;private, max-age&#x3D;0&quot;
}, {
&quot;name&quot; : &quot;content-encoding&quot;,
&quot;value&quot; : &quot;br&quot;
}, {
&quot;name&quot; : &quot;content-length&quot;,
&quot;value&quot; : &quot;65214&quot;
}, {
&quot;name&quot; : &quot;content-type&quot;,
&quot;value&quot; : &quot;text/html; charset&#x3D;UTF-8&quot;
}, {
&quot;name&quot; : &quot;date&quot;,
&quot;value&quot; : &quot;Fri, 15 Nov 2019 16:41:54 GMT&quot;
}, {
&quot;name&quot; : &quot;expires&quot;,
&quot;value&quot; : &quot;-1&quot;
}, {
&quot;name&quot; : &quot;p3p&quot;,
&quot;value&quot; : &quot;CP&#x3D;\&quot;This is not a P3P policy! See g.co/p3phelp for more info.\&quot;&quot;
}, {
&quot;name&quot; : &quot;server&quot;,
&quot;value&quot; : &quot;gws&quot;
}, {
&quot;name&quot; : &quot;set-cookie&quot;,
&quot;value&quot; : &quot;(removed)&quot;
}, {
&quot;name&quot; : &quot;status&quot;,
&quot;value&quot; : &quot;200&quot;
}, {
&quot;name&quot; : &quot;strict-transport-security&quot;,
&quot;value&quot; : &quot;max-age&#x3D;31536000&quot;
}, {
&quot;name&quot; : &quot;x-frame-options&quot;,
&quot;value&quot; : &quot;SAMEORIGIN&quot;
}, {
&quot;name&quot; : &quot;x-xss-protection&quot;,
&quot;value&quot; : &quot;0&quot;
} ],
&quot;headersSize&quot; : 915,
&quot;redirectURL&quot; : &quot;&quot;,
&quot;status&quot; : 200,
&quot;statusText&quot; : &quot;OK&quot;
},
&quot;serverIPAddress&quot; : &quot;172.217.4.196&quot;,
&quot;startedDateTime&quot; : &quot;2019-11-15T16:41:54.870Z&quot;,
&quot;time&quot; : 182,
&quot;timings&quot; : {
&quot;blocked&quot; : 2,
&quot;connect&quot; : 4,
&quot;dns&quot; : 0,
&quot;receive&quot; : 58,
&quot;send&quot; : 0,
&quot;ssl&quot; : 2,
&quot;wait&quot; : 118
}
} ],
&quot;pages&quot; : [ {
&quot;id&quot; : &quot;page_0&quot;,
&quot;pageTimings&quot; : {
&quot;onContentLoad&quot; : 367,
&quot;onLoad&quot; : 737
},
&quot;responseCode&quot; : 0,
&quot;startedDateTime&quot; : &quot;2019-11-15T16:41:54.796Z&quot;,
&quot;title&quot; : &quot;Google&quot;
} ],
&quot;version&quot; : &quot;1.2&quot;
}
},
&quot;startTime&quot; : 1384309800,
&quot;endTime&quot; : 1384309800,
&quot;markers&quot; : [ {
&quot;duration&quot; : 1360,
&quot;name&quot; : &quot;SearchForWebdriver&quot;
}, {
&quot;duration&quot; : 1360,
&quot;name&quot; : &quot;SearchForWebdriver&quot;
} ],
&quot;roundId&quot; : 1384309800,
&quot;errorDetails&quot; : &quot;Connection error&quot;
} ]
}
"""
expected_response = json.loads(response_body_json)
response = self.api.get_test_web_transaction_agent_round_page_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
page_id=page_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_page_results"),
)
assert_constructed_model_matches_example_json(response, expected_response)
def test_get_test_web_transaction_agent_round_page_results_error_400(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_page_results error path (HTTP 400)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
page_id = '281474976710706'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"errors" : [ {
"code" : "code",
"field" : "field",
"message" : "message"
}, {
"code" : "code",
"field" : "field",
"message" : "message"
} ],
"status" : 0
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(400)
) as context:
self.api.get_test_web_transaction_agent_round_page_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
page_id=page_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_page_results", error_status="400"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_page_results_error_401(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_page_results error path (HTTP 401)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
page_id = '281474976710706'
aid = '1234'
error_body_json = """
{
"error_description" : "Invalid access token",
"error" : "invalid_token"
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(401)
) as context:
self.api.get_test_web_transaction_agent_round_page_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
page_id=page_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_page_results", error_status="401"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_page_results_error_403(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_page_results error path (HTTP 403)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
page_id = '281474976710706'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(403)
) as context:
self.api.get_test_web_transaction_agent_round_page_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
page_id=page_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_page_results", error_status="403"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_page_results_error_404(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_page_results error path (HTTP 404)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
page_id = '281474976710706'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(404)
) as context:
self.api.get_test_web_transaction_agent_round_page_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
page_id=page_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_page_results", error_status="404"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_page_results_error_429(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_page_results error path (HTTP 429)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
page_id = '281474976710706'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(429)
) as context:
self.api.get_test_web_transaction_agent_round_page_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
page_id=page_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_page_results", error_status="429"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_page_results_error_500(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_page_results error path (HTTP 500)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
page_id = '281474976710706'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(500)
) as context:
self.api.get_test_web_transaction_agent_round_page_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
page_id=page_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_page_results", error_status="500"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_page_results_error_502(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_page_results error path (HTTP 502)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
page_id = '281474976710706'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(502)
) as context:
self.api.get_test_web_transaction_agent_round_page_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
page_id=page_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_page_results", error_status="502"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_results_happy_path(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_results success path"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
aid = '1234'
response_body_json = """
{
&quot;test&quot; : {
&quot;_links&quot; : {
&quot;testResults&quot; : [ {
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/test-results/281474976710706/network&quot;
}, {
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis&quot;
} ],
&quot;self&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;liveShare&quot; : false,
&quot;savedEvent&quot; : true,
&quot;description&quot; : &quot;ThousandEyes Test&quot;,
&quot;type&quot; : &quot;agent-to-server&quot;,
&quot;enabled&quot; : true,
&quot;createdDate&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;createdBy&quot; : &quot;user@user.com&quot;,
&quot;modifiedDate&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;interval&quot; : 60,
&quot;modifiedBy&quot; : &quot;user@user.com&quot;,
&quot;testId&quot; : &quot;281474976710706&quot;,
&quot;alertsEnabled&quot; : true,
&quot;testName&quot; : &quot;ThousandEyes Test&quot;
},
&quot;_links&quot; : {
&quot;next&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
},
&quot;previous&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
},
&quot;self&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;results&quot; : [ {
&quot;date&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;agent&quot; : {
&quot;agentId&quot; : &quot;281474976710706&quot;,
&quot;agentName&quot; : &quot;thousandeyes-stg-va-254&quot;,
&quot;location&quot; : &quot;San Francisco Bay Area&quot;,
&quot;countryId&quot; : &quot;US&quot;
},
&quot;pages&quot; : [ {
&quot;duration&quot; : 1117.5660001039505,
&quot;componentCount&quot; : 136,
&quot;pageNum&quot; : 0,
&quot;pageName&quot; : &quot;Google&quot;,
&quot;errorCount&quot; : 0
}, {
&quot;duration&quot; : 1117.5660001039505,
&quot;componentCount&quot; : 136,
&quot;pageNum&quot; : 0,
&quot;pageName&quot; : &quot;Google&quot;,
&quot;errorCount&quot; : 0
} ],
&quot;_links&quot; : {
&quot;appLink&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;componentErrors&quot; : 5,
&quot;errorType&quot; : &quot;None&quot;,
&quot;startTime&quot; : 1384309800,
&quot;endTime&quot; : 1384309800,
&quot;transactionTime&quot; : 2379,
&quot;markers&quot; : [ {
&quot;duration&quot; : 1360,
&quot;name&quot; : &quot;SearchForWebdriver&quot;
}, {
&quot;duration&quot; : 1360,
&quot;name&quot; : &quot;SearchForWebdriver&quot;
} ],
&quot;roundId&quot; : 1384309800,
&quot;errorDetails&quot; : &quot;Connection error&quot;
}, {
&quot;date&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;agent&quot; : {
&quot;agentId&quot; : &quot;281474976710706&quot;,
&quot;agentName&quot; : &quot;thousandeyes-stg-va-254&quot;,
&quot;location&quot; : &quot;San Francisco Bay Area&quot;,
&quot;countryId&quot; : &quot;US&quot;
},
&quot;pages&quot; : [ {
&quot;duration&quot; : 1117.5660001039505,
&quot;componentCount&quot; : 136,
&quot;pageNum&quot; : 0,
&quot;pageName&quot; : &quot;Google&quot;,
&quot;errorCount&quot; : 0
}, {
&quot;duration&quot; : 1117.5660001039505,
&quot;componentCount&quot; : 136,
&quot;pageNum&quot; : 0,
&quot;pageName&quot; : &quot;Google&quot;,
&quot;errorCount&quot; : 0
} ],
&quot;_links&quot; : {
&quot;appLink&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;componentErrors&quot; : 5,
&quot;errorType&quot; : &quot;None&quot;,
&quot;startTime&quot; : 1384309800,
&quot;endTime&quot; : 1384309800,
&quot;transactionTime&quot; : 2379,
&quot;markers&quot; : [ {
&quot;duration&quot; : 1360,
&quot;name&quot; : &quot;SearchForWebdriver&quot;
}, {
&quot;duration&quot; : 1360,
&quot;name&quot; : &quot;SearchForWebdriver&quot;
} ],
&quot;roundId&quot; : 1384309800,
&quot;errorDetails&quot; : &quot;Connection error&quot;
} ]
}
"""
expected_response = json.loads(response_body_json)
response = self.api.get_test_web_transaction_agent_round_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_results"),
)
assert_constructed_model_matches_example_json(response, expected_response)
def test_get_test_web_transaction_agent_round_results_error_400(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_results error path (HTTP 400)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"errors" : [ {
"code" : "code",
"field" : "field",
"message" : "message"
}, {
"code" : "code",
"field" : "field",
"message" : "message"
} ],
"status" : 0
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(400)
) as context:
self.api.get_test_web_transaction_agent_round_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_results", error_status="400"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_results_error_401(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_results error path (HTTP 401)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
aid = '1234'
error_body_json = """
{
"error_description" : "Invalid access token",
"error" : "invalid_token"
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(401)
) as context:
self.api.get_test_web_transaction_agent_round_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_results", error_status="401"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_results_error_403(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_results error path (HTTP 403)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(403)
) as context:
self.api.get_test_web_transaction_agent_round_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_results", error_status="403"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_results_error_404(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_results error path (HTTP 404)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(404)
) as context:
self.api.get_test_web_transaction_agent_round_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_results", error_status="404"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_results_error_429(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_results error path (HTTP 429)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(429)
) as context:
self.api.get_test_web_transaction_agent_round_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_results", error_status="429"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_results_error_500(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_results error path (HTTP 500)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(500)
) as context:
self.api.get_test_web_transaction_agent_round_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_results", error_status="500"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_agent_round_results_error_502(self) -> None:
"""Integration test for get_test_web_transaction_agent_round_results error path (HTTP 502)"""
test_id = '202701'
agent_id = '11'
round_id = '1384309800'
aid = '1234'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(502)
) as context:
self.api.get_test_web_transaction_agent_round_results(
test_id=test_id,
agent_id=agent_id,
round_id=round_id,
aid=aid,
_headers=self.te_headers("get_test_web_transaction_agent_round_results", error_status="502"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_results_happy_path(self) -> None:
"""Integration test for get_test_web_transaction_results success path"""
test_id = '202701'
aid = '1234'
window = '12h'
start_date = '2022-07-17T22:00:54Z'
end_date = '2022-07-18T22:00:54Z'
cursor = 'cursor_example'
response_body_json = """
{
&quot;test&quot; : {
&quot;_links&quot; : {
&quot;testResults&quot; : [ {
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/test-results/281474976710706/network&quot;
}, {
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis&quot;
} ],
&quot;self&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;liveShare&quot; : false,
&quot;savedEvent&quot; : true,
&quot;description&quot; : &quot;ThousandEyes Test&quot;,
&quot;type&quot; : &quot;agent-to-server&quot;,
&quot;enabled&quot; : true,
&quot;createdDate&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;createdBy&quot; : &quot;user@user.com&quot;,
&quot;modifiedDate&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;interval&quot; : 60,
&quot;modifiedBy&quot; : &quot;user@user.com&quot;,
&quot;testId&quot; : &quot;281474976710706&quot;,
&quot;alertsEnabled&quot; : true,
&quot;testName&quot; : &quot;ThousandEyes Test&quot;
},
&quot;endDate&quot; : &quot;2022-07-18T22:00:54Z&quot;,
&quot;_links&quot; : {
&quot;next&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
},
&quot;previous&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
},
&quot;self&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;results&quot; : [ {
&quot;date&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;agent&quot; : {
&quot;agentId&quot; : &quot;281474976710706&quot;,
&quot;agentName&quot; : &quot;thousandeyes-stg-va-254&quot;,
&quot;location&quot; : &quot;San Francisco Bay Area&quot;,
&quot;countryId&quot; : &quot;US&quot;
},
&quot;_links&quot; : {
&quot;appLink&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;componentErrors&quot; : 5,
&quot;errorType&quot; : &quot;None&quot;,
&quot;startTime&quot; : 1384309800,
&quot;endTime&quot; : 1384309800,
&quot;transactionTime&quot; : 2379,
&quot;roundId&quot; : 1384309800,
&quot;errorDetails&quot; : &quot;Connection error&quot;
}, {
&quot;date&quot; : &quot;2022-07-17T22:00:54Z&quot;,
&quot;agent&quot; : {
&quot;agentId&quot; : &quot;281474976710706&quot;,
&quot;agentName&quot; : &quot;thousandeyes-stg-va-254&quot;,
&quot;location&quot; : &quot;San Francisco Bay Area&quot;,
&quot;countryId&quot; : &quot;US&quot;
},
&quot;_links&quot; : {
&quot;appLink&quot; : {
&quot;hreflang&quot; : &quot;hreflang&quot;,
&quot;templated&quot; : true,
&quot;profile&quot; : &quot;profile&quot;,
&quot;name&quot; : &quot;name&quot;,
&quot;href&quot; : &quot;https://api.thousandeyes.com/v7/link/to/resource/id&quot;,
&quot;type&quot; : &quot;type&quot;,
&quot;deprecation&quot; : &quot;deprecation&quot;,
&quot;title&quot; : &quot;title&quot;
}
},
&quot;componentErrors&quot; : 5,
&quot;errorType&quot; : &quot;None&quot;,
&quot;startTime&quot; : 1384309800,
&quot;endTime&quot; : 1384309800,
&quot;transactionTime&quot; : 2379,
&quot;roundId&quot; : 1384309800,
&quot;errorDetails&quot; : &quot;Connection error&quot;
} ],
&quot;startDate&quot; : &quot;2022-07-17T22:00:54Z&quot;
}
"""
expected_response = json.loads(response_body_json)
response = self.api.get_test_web_transaction_results(
test_id=test_id,
aid=aid,
window=window,
start_date=start_date,
end_date=end_date,
cursor=cursor,
_headers=self.te_headers("get_test_web_transaction_results"),
)
assert_constructed_model_matches_example_json(response, expected_response)
def test_get_test_web_transaction_results_error_400(self) -> None:
"""Integration test for get_test_web_transaction_results error path (HTTP 400)"""
test_id = '202701'
aid = '1234'
window = '12h'
start_date = '2022-07-17T22:00:54Z'
end_date = '2022-07-18T22:00:54Z'
cursor = 'cursor_example'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"errors" : [ {
"code" : "code",
"field" : "field",
"message" : "message"
}, {
"code" : "code",
"field" : "field",
"message" : "message"
} ],
"status" : 0
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(400)
) as context:
self.api.get_test_web_transaction_results(
test_id=test_id,
aid=aid,
window=window,
start_date=start_date,
end_date=end_date,
cursor=cursor,
_headers=self.te_headers("get_test_web_transaction_results", error_status="400"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_results_error_401(self) -> None:
"""Integration test for get_test_web_transaction_results error path (HTTP 401)"""
test_id = '202701'
aid = '1234'
window = '12h'
start_date = '2022-07-17T22:00:54Z'
end_date = '2022-07-18T22:00:54Z'
cursor = 'cursor_example'
error_body_json = """
{
"error_description" : "Invalid access token",
"error" : "invalid_token"
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(401)
) as context:
self.api.get_test_web_transaction_results(
test_id=test_id,
aid=aid,
window=window,
start_date=start_date,
end_date=end_date,
cursor=cursor,
_headers=self.te_headers("get_test_web_transaction_results", error_status="401"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_results_error_403(self) -> None:
"""Integration test for get_test_web_transaction_results error path (HTTP 403)"""
test_id = '202701'
aid = '1234'
window = '12h'
start_date = '2022-07-17T22:00:54Z'
end_date = '2022-07-18T22:00:54Z'
cursor = 'cursor_example'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(403)
) as context:
self.api.get_test_web_transaction_results(
test_id=test_id,
aid=aid,
window=window,
start_date=start_date,
end_date=end_date,
cursor=cursor,
_headers=self.te_headers("get_test_web_transaction_results", error_status="403"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_results_error_404(self) -> None:
"""Integration test for get_test_web_transaction_results error path (HTTP 404)"""
test_id = '202701'
aid = '1234'
window = '12h'
start_date = '2022-07-17T22:00:54Z'
end_date = '2022-07-18T22:00:54Z'
cursor = 'cursor_example'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(404)
) as context:
self.api.get_test_web_transaction_results(
test_id=test_id,
aid=aid,
window=window,
start_date=start_date,
end_date=end_date,
cursor=cursor,
_headers=self.te_headers("get_test_web_transaction_results", error_status="404"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_results_error_429(self) -> None:
"""Integration test for get_test_web_transaction_results error path (HTTP 429)"""
test_id = '202701'
aid = '1234'
window = '12h'
start_date = '2022-07-17T22:00:54Z'
end_date = '2022-07-18T22:00:54Z'
cursor = 'cursor_example'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(429)
) as context:
self.api.get_test_web_transaction_results(
test_id=test_id,
aid=aid,
window=window,
start_date=start_date,
end_date=end_date,
cursor=cursor,
_headers=self.te_headers("get_test_web_transaction_results", error_status="429"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_results_error_500(self) -> None:
"""Integration test for get_test_web_transaction_results error path (HTTP 500)"""
test_id = '202701'
aid = '1234'
window = '12h'
start_date = '2022-07-17T22:00:54Z'
end_date = '2022-07-18T22:00:54Z'
cursor = 'cursor_example'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(500)
) as context:
self.api.get_test_web_transaction_results(
test_id=test_id,
aid=aid,
window=window,
start_date=start_date,
end_date=end_date,
cursor=cursor,
_headers=self.te_headers("get_test_web_transaction_results", error_status="500"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
def test_get_test_web_transaction_results_error_502(self) -> None:
"""Integration test for get_test_web_transaction_results error path (HTTP 502)"""
test_id = '202701'
aid = '1234'
window = '12h'
start_date = '2022-07-17T22:00:54Z'
end_date = '2022-07-18T22:00:54Z'
cursor = 'cursor_example'
error_body_json = """
{
"instance" : "instance",
"detail" : "detail",
"type" : "type",
"title" : "title",
"status" : 6
}
"""
expected_error = json.loads(error_body_json)
with self.assertRaises(
ApiException.exception_class_for_http_status(502)
) as context:
self.api.get_test_web_transaction_results(
test_id=test_id,
aid=aid,
window=window,
start_date=start_date,
end_date=end_date,
cursor=cursor,
_headers=self.te_headers("get_test_web_transaction_results", error_status="502"),
)
assert_constructed_model_matches_example_json(context.exception.data, expected_error)
if __name__ == '__main__':
unittest.main()