# 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 thousandeyes_sdk.core.exceptions import ApiException
from thousandeyes_sdk.endpoint_test_results.api.network_endpoint_scheduled_test_results_api import NetworkEndpointScheduledTestResultsApi
from .integration_test_utils import IntegrationTestBase
from .test_utils import assert_constructed_model_matches_example_json


class TestNetworkEndpointScheduledTestResultsApiIntegration(IntegrationTestBase):
    """NetworkEndpointScheduledTestResultsApi integration test stubs"""

    def setUp(self) -> None:
        super().setUp()
        self.api = NetworkEndpointScheduledTestResultsApi(self.api_client)


    def test_filter_scheduled_test_network_results_happy_path(self) -> None:
        """Integration test for filter_scheduled_test_network_results success path"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.EndpointTestsDataRoundsSearch.from_json(request_body_json)
        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 = """
                {
                  "test" : {
                    "server" : "www.example.com",
                    "isSavedEvent" : false,
                    "_links" : {
                      "testResults" : [ {
                        "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"
                      }, {
                        "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"
                      } ],
                      "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"
                      }
                    },
                    "isPrioritized" : false,
                    "networkMeasurements" : true,
                    "type" : "agent-to-server",
                    "tcpProbeMode" : "auto",
                    "labels" : [ {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    }, {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    } ],
                    "protocol" : "icmp",
                    "createdDate" : "2022-07-17T22:00:54Z",
                    "ipVersion" : "V4_ONLY",
                    "port" : 443,
                    "isEnabled" : true,
                    "modifiedDate" : "2022-07-17T22:00:54Z",
                    "interval" : 60,
                    "testId" : "281474976710706",
                    "aid" : "1234",
                    "agentSelectorConfig" : {
                      "agentSelectorType" : "all-agents",
                      "maxMachines" : 25
                    },
                    "hasPathTraceInSession" : true,
                    "testName" : "Test name"
                  },
                  "totalHits" : 12,
                  "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" : [ {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "isIcmpBlocked" : true,
                    "avgLatency" : 167.04,
                    "minLatency" : 167,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "maxLatency" : 168,
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "loss" : 0,
                    "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
                    },
                    "jitter" : 0.076808,
                    "serverIp" : "185.199.108.153",
                    "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",
                        "snr" : 57,
                        "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"
                    },
                    "ztaMetrics" : [ {
                      "loss" : 50,
                      "jitter" : 5,
                      "avgLatency" : 3,
                      "errorMessage" : "ERR_NAME_NOT_RESOLVED",
                      "type" : "zta_service"
                    }, {
                      "loss" : 50,
                      "jitter" : 5,
                      "avgLatency" : 3,
                      "errorMessage" : "ERR_NAME_NOT_RESOLVED",
                      "type" : "zta_service"
                    } ],
                    "testId" : "584739201",
                    "aid" : "1234",
                    "roundId" : 1384309800,
                    "errorDetails" : "Error"
                  }, {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "isIcmpBlocked" : true,
                    "avgLatency" : 167.04,
                    "minLatency" : 167,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "maxLatency" : 168,
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "loss" : 0,
                    "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
                    },
                    "jitter" : 0.076808,
                    "serverIp" : "185.199.108.153",
                    "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",
                        "snr" : 57,
                        "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"
                    },
                    "ztaMetrics" : [ {
                      "loss" : 50,
                      "jitter" : 5,
                      "avgLatency" : 3,
                      "errorMessage" : "ERR_NAME_NOT_RESOLVED",
                      "type" : "zta_service"
                    }, {
                      "loss" : 50,
                      "jitter" : 5,
                      "avgLatency" : 3,
                      "errorMessage" : "ERR_NAME_NOT_RESOLVED",
                      "type" : "zta_service"
                    } ],
                    "testId" : "584739201",
                    "aid" : "1234",
                    "roundId" : 1384309800,
                    "errorDetails" : "Error"
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.filter_scheduled_test_network_results(

            test_id=test_id,

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            cursor=cursor,

            endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search,

            _headers=self.te_headers("filter_scheduled_test_network_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_filter_scheduled_test_network_results_error_401(self) -> None:
        """Integration test for filter_scheduled_test_network_results error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.EndpointTestsDataRoundsSearch.from_json(request_body_json)
        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.filter_scheduled_test_network_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_test_network_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_test_network_results_error_403(self) -> None:
        """Integration test for filter_scheduled_test_network_results error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.EndpointTestsDataRoundsSearch.from_json(request_body_json)
        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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.filter_scheduled_test_network_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_test_network_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_test_network_results_error_404(self) -> None:
        """Integration test for filter_scheduled_test_network_results error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.EndpointTestsDataRoundsSearch.from_json(request_body_json)
        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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.filter_scheduled_test_network_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_test_network_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_test_network_results_error_429(self) -> None:
        """Integration test for filter_scheduled_test_network_results error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.EndpointTestsDataRoundsSearch.from_json(request_body_json)
        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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.filter_scheduled_test_network_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_test_network_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_test_network_results_error_500(self) -> None:
        """Integration test for filter_scheduled_test_network_results error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.EndpointTestsDataRoundsSearch.from_json(request_body_json)
        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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.filter_scheduled_test_network_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_test_network_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_test_network_results_error_502(self) -> None:
        """Integration test for filter_scheduled_test_network_results error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.EndpointTestsDataRoundsSearch.from_json(request_body_json)
        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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.filter_scheduled_test_network_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                endpoint_tests_data_rounds_search=endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_test_network_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)




    def test_filter_scheduled_tests_network_results_happy_path(self) -> None:
        """Integration test for filter_scheduled_tests_network_results success path"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        multi_test_id_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdEndpointTestsDataRoundsSearch.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        max = 5
        cursor = 'cursor_example'
        use_all_permitted_aids = False
        response_body_json = """
                {
                  "totalHits" : 12,
                  "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" : [ {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "isIcmpBlocked" : true,
                    "avgLatency" : 167.04,
                    "minLatency" : 167,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "maxLatency" : 168,
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "loss" : 0,
                    "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
                    },
                    "jitter" : 0.076808,
                    "serverIp" : "185.199.108.153",
                    "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",
                        "snr" : 57,
                        "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"
                    },
                    "ztaMetrics" : [ {
                      "loss" : 50,
                      "jitter" : 5,
                      "avgLatency" : 3,
                      "errorMessage" : "ERR_NAME_NOT_RESOLVED",
                      "type" : "zta_service"
                    }, {
                      "loss" : 50,
                      "jitter" : 5,
                      "avgLatency" : 3,
                      "errorMessage" : "ERR_NAME_NOT_RESOLVED",
                      "type" : "zta_service"
                    } ],
                    "testId" : "584739201",
                    "aid" : "1234",
                    "roundId" : 1384309800,
                    "errorDetails" : "Error"
                  }, {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "isIcmpBlocked" : true,
                    "avgLatency" : 167.04,
                    "minLatency" : 167,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "maxLatency" : 168,
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "loss" : 0,
                    "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
                    },
                    "jitter" : 0.076808,
                    "serverIp" : "185.199.108.153",
                    "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",
                        "snr" : 57,
                        "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"
                    },
                    "ztaMetrics" : [ {
                      "loss" : 50,
                      "jitter" : 5,
                      "avgLatency" : 3,
                      "errorMessage" : "ERR_NAME_NOT_RESOLVED",
                      "type" : "zta_service"
                    }, {
                      "loss" : 50,
                      "jitter" : 5,
                      "avgLatency" : 3,
                      "errorMessage" : "ERR_NAME_NOT_RESOLVED",
                      "type" : "zta_service"
                    } ],
                    "testId" : "584739201",
                    "aid" : "1234",
                    "roundId" : 1384309800,
                    "errorDetails" : "Error"
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.filter_scheduled_tests_network_results(

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            max=max,

            cursor=cursor,

            use_all_permitted_aids=use_all_permitted_aids,

            multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search,

            _headers=self.te_headers("filter_scheduled_tests_network_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_filter_scheduled_tests_network_results_error_401(self) -> None:
        """Integration test for filter_scheduled_tests_network_results error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        multi_test_id_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdEndpointTestsDataRoundsSearch.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        max = 5
        cursor = 'cursor_example'
        use_all_permitted_aids = False
        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.filter_scheduled_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                max=max,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_tests_network_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_tests_network_results_error_403(self) -> None:
        """Integration test for filter_scheduled_tests_network_results error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        multi_test_id_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdEndpointTestsDataRoundsSearch.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        max = 5
        cursor = 'cursor_example'
        use_all_permitted_aids = False
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.filter_scheduled_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                max=max,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_tests_network_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_tests_network_results_error_404(self) -> None:
        """Integration test for filter_scheduled_tests_network_results error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        multi_test_id_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdEndpointTestsDataRoundsSearch.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        max = 5
        cursor = 'cursor_example'
        use_all_permitted_aids = False
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.filter_scheduled_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                max=max,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_tests_network_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_tests_network_results_error_429(self) -> None:
        """Integration test for filter_scheduled_tests_network_results error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        multi_test_id_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdEndpointTestsDataRoundsSearch.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        max = 5
        cursor = 'cursor_example'
        use_all_permitted_aids = False
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.filter_scheduled_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                max=max,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_tests_network_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_tests_network_results_error_500(self) -> None:
        """Integration test for filter_scheduled_tests_network_results error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        multi_test_id_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdEndpointTestsDataRoundsSearch.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        max = 5
        cursor = 'cursor_example'
        use_all_permitted_aids = False
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.filter_scheduled_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                max=max,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_tests_network_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_scheduled_tests_network_results_error_502(self) -> None:
        """Integration test for filter_scheduled_tests_network_results error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "loss",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        multi_test_id_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.MultiTestIdEndpointTestsDataRoundsSearch.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        max = 5
        cursor = 'cursor_example'
        use_all_permitted_aids = False
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.filter_scheduled_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                max=max,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                multi_test_id_endpoint_tests_data_rounds_search=multi_test_id_endpoint_tests_data_rounds_search,

                _headers=self.te_headers("filter_scheduled_tests_network_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)




    def test_get_scheduled_test_path_vis_agent_round_results_happy_path(self) -> None:
        """Integration test for get_scheduled_test_path_vis_agent_round_results success path"""
        test_id = '202701'
        agent_id = '11'
        round_id = '1384309800'
        aid = '1234'
        response_body_json = """
                {
                  "test" : {
                    "server" : "www.example.com",
                    "isSavedEvent" : false,
                    "_links" : {
                      "testResults" : [ {
                        "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"
                      }, {
                        "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"
                      } ],
                      "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"
                      }
                    },
                    "isPrioritized" : false,
                    "networkMeasurements" : true,
                    "type" : "agent-to-server",
                    "tcpProbeMode" : "auto",
                    "labels" : [ {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    }, {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    } ],
                    "protocol" : "icmp",
                    "createdDate" : "2022-07-17T22:00:54Z",
                    "ipVersion" : "V4_ONLY",
                    "port" : 443,
                    "isEnabled" : true,
                    "modifiedDate" : "2022-07-17T22:00:54Z",
                    "interval" : 60,
                    "testId" : "281474976710706",
                    "aid" : "1234",
                    "agentSelectorConfig" : {
                      "agentSelectorType" : "all-agents",
                      "maxMachines" : 25
                    },
                    "hasPathTraceInSession" : true,
                    "testName" : "Test name"
                  },
                  "_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" : [ {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "server" : "www.google.com:443",
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "asnDetails" : {
                      "asName" : "ThousandEyes, Inc",
                      "asNumber" : 394101
                    },
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "sourcePrefix" : "196.40.96.0/20",
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "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
                    },
                    "sourceIp" : "196.40.106.237",
                    "pathTraces" : [ {
                      "protocol" : "tcp",
                      "udpPathTraceMode" : "unknown",
                      "hops" : [ {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      }, {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      } ],
                      "pathId" : "4711301366345855606023718047703941305741293841502186803",
                      "tcpPathTraceMode" : "syn-pcap"
                    }, {
                      "protocol" : "tcp",
                      "udpPathTraceMode" : "unknown",
                      "hops" : [ {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      }, {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      } ],
                      "pathId" : "4711301366345855606023718047703941305741293841502186803",
                      "tcpPathTraceMode" : "syn-pcap"
                    } ],
                    "vpnPathTraces" : [ {
                      "protocol" : "tcp",
                      "udpPathTraceMode" : "unknown",
                      "hops" : [ {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      }, {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      } ],
                      "pathId" : "4711301366345855606023718047703941305741293841502186803",
                      "tcpPathTraceMode" : "syn-pcap"
                    }, {
                      "protocol" : "tcp",
                      "udpPathTraceMode" : "unknown",
                      "hops" : [ {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      }, {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      } ],
                      "pathId" : "4711301366345855606023718047703941305741293841502186803",
                      "tcpPathTraceMode" : "syn-pcap"
                    } ],
                    "serverIp" : "185.199.108.153",
                    "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",
                        "snr" : 57,
                        "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"
                    },
                    "testId" : "584739201",
                    "aid" : "1234",
                    "roundId" : 1384309800
                  }, {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "server" : "www.google.com:443",
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "asnDetails" : {
                      "asName" : "ThousandEyes, Inc",
                      "asNumber" : 394101
                    },
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "sourcePrefix" : "196.40.96.0/20",
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "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
                    },
                    "sourceIp" : "196.40.106.237",
                    "pathTraces" : [ {
                      "protocol" : "tcp",
                      "udpPathTraceMode" : "unknown",
                      "hops" : [ {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      }, {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      } ],
                      "pathId" : "4711301366345855606023718047703941305741293841502186803",
                      "tcpPathTraceMode" : "syn-pcap"
                    }, {
                      "protocol" : "tcp",
                      "udpPathTraceMode" : "unknown",
                      "hops" : [ {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      }, {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      } ],
                      "pathId" : "4711301366345855606023718047703941305741293841502186803",
                      "tcpPathTraceMode" : "syn-pcap"
                    } ],
                    "vpnPathTraces" : [ {
                      "protocol" : "tcp",
                      "udpPathTraceMode" : "unknown",
                      "hops" : [ {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      }, {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      } ],
                      "pathId" : "4711301366345855606023718047703941305741293841502186803",
                      "tcpPathTraceMode" : "syn-pcap"
                    }, {
                      "protocol" : "tcp",
                      "udpPathTraceMode" : "unknown",
                      "hops" : [ {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      }, {
                        "rdns" : "core-router1.cpt2.host-h.net",
                        "prefix" : "196.40.96.0/20",
                        "responseTime" : 1,
                        "hop" : 1,
                        "ipAddress" : "196.40.106.237",
                        "location" : "Cape Town, South Africa",
                        "network" : "HETZNER (Pty) Ltd (AS 37153)"
                      } ],
                      "pathId" : "4711301366345855606023718047703941305741293841502186803",
                      "tcpPathTraceMode" : "syn-pcap"
                    } ],
                    "serverIp" : "185.199.108.153",
                    "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",
                        "snr" : 57,
                        "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"
                    },
                    "testId" : "584739201",
                    "aid" : "1234",
                    "roundId" : 1384309800
                  } ]
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_scheduled_test_path_vis_agent_round_results(

            test_id=test_id,

            agent_id=agent_id,

            round_id=round_id,

            aid=aid,

            _headers=self.te_headers("get_scheduled_test_path_vis_agent_round_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_get_scheduled_test_path_vis_agent_round_results_error_401(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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_scheduled_test_path_vis_agent_round_results(

                test_id=test_id,

                agent_id=agent_id,

                round_id=round_id,

                aid=aid,

                _headers=self.te_headers("get_scheduled_test_path_vis_agent_round_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_agent_round_results_error_403(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.get_scheduled_test_path_vis_agent_round_results(

                test_id=test_id,

                agent_id=agent_id,

                round_id=round_id,

                aid=aid,

                _headers=self.te_headers("get_scheduled_test_path_vis_agent_round_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_agent_round_results_error_404(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.get_scheduled_test_path_vis_agent_round_results(

                test_id=test_id,

                agent_id=agent_id,

                round_id=round_id,

                aid=aid,

                _headers=self.te_headers("get_scheduled_test_path_vis_agent_round_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_agent_round_results_error_429(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.get_scheduled_test_path_vis_agent_round_results(

                test_id=test_id,

                agent_id=agent_id,

                round_id=round_id,

                aid=aid,

                _headers=self.te_headers("get_scheduled_test_path_vis_agent_round_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_agent_round_results_error_500(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.get_scheduled_test_path_vis_agent_round_results(

                test_id=test_id,

                agent_id=agent_id,

                round_id=round_id,

                aid=aid,

                _headers=self.te_headers("get_scheduled_test_path_vis_agent_round_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_agent_round_results_error_502(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.get_scheduled_test_path_vis_agent_round_results(

                test_id=test_id,

                agent_id=agent_id,

                round_id=round_id,

                aid=aid,

                _headers=self.te_headers("get_scheduled_test_path_vis_agent_round_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)




    def test_get_scheduled_test_path_vis_results_happy_path(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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 = """
                {
                  "test" : {
                    "server" : "www.example.com",
                    "isSavedEvent" : false,
                    "_links" : {
                      "testResults" : [ {
                        "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"
                      }, {
                        "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"
                      } ],
                      "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"
                      }
                    },
                    "isPrioritized" : false,
                    "networkMeasurements" : true,
                    "type" : "agent-to-server",
                    "tcpProbeMode" : "auto",
                    "labels" : [ {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    }, {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    } ],
                    "protocol" : "icmp",
                    "createdDate" : "2022-07-17T22:00:54Z",
                    "ipVersion" : "V4_ONLY",
                    "port" : 443,
                    "isEnabled" : true,
                    "modifiedDate" : "2022-07-17T22:00:54Z",
                    "interval" : 60,
                    "testId" : "281474976710706",
                    "aid" : "1234",
                    "agentSelectorConfig" : {
                      "agentSelectorType" : "all-agents",
                      "maxMachines" : 25
                    },
                    "hasPathTraceInSession" : true,
                    "testName" : "Test name"
                  },
                  "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"
                    },
                    "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" : [ {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "server" : "www.google.com:443",
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "asnDetails" : {
                      "asName" : "ThousandEyes, Inc",
                      "asNumber" : 394101
                    },
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "sourcePrefix" : "196.40.96.0/20",
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "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
                    },
                    "sourceIp" : "196.40.106.237",
                    "pathTraces" : [ {
                      "protocol" : "tcp",
                      "numberOfHops" : 15,
                      "responseTime" : 1500,
                      "ipAddress" : "196.40.106.237",
                      "udpPathTraceMode" : "unknown",
                      "pathId" : "1230899668701775614109128428722974545787322404682781961521",
                      "tcpPathTraceMode" : "syn-pcap"
                    }, {
                      "protocol" : "tcp",
                      "numberOfHops" : 15,
                      "responseTime" : 1500,
                      "ipAddress" : "196.40.106.237",
                      "udpPathTraceMode" : "unknown",
                      "pathId" : "1230899668701775614109128428722974545787322404682781961521",
                      "tcpPathTraceMode" : "syn-pcap"
                    } ],
                    "serverIp" : "185.199.108.153",
                    "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",
                        "snr" : 57,
                        "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"
                    },
                    "testId" : "584739201",
                    "location" : "San Francisco Area",
                    "aid" : "1234",
                    "roundId" : 1384309800
                  }, {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "server" : "www.google.com:443",
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "asnDetails" : {
                      "asName" : "ThousandEyes, Inc",
                      "asNumber" : 394101
                    },
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "sourcePrefix" : "196.40.96.0/20",
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "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
                    },
                    "sourceIp" : "196.40.106.237",
                    "pathTraces" : [ {
                      "protocol" : "tcp",
                      "numberOfHops" : 15,
                      "responseTime" : 1500,
                      "ipAddress" : "196.40.106.237",
                      "udpPathTraceMode" : "unknown",
                      "pathId" : "1230899668701775614109128428722974545787322404682781961521",
                      "tcpPathTraceMode" : "syn-pcap"
                    }, {
                      "protocol" : "tcp",
                      "numberOfHops" : 15,
                      "responseTime" : 1500,
                      "ipAddress" : "196.40.106.237",
                      "udpPathTraceMode" : "unknown",
                      "pathId" : "1230899668701775614109128428722974545787322404682781961521",
                      "tcpPathTraceMode" : "syn-pcap"
                    } ],
                    "serverIp" : "185.199.108.153",
                    "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",
                        "snr" : 57,
                        "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"
                    },
                    "testId" : "584739201",
                    "location" : "San Francisco Area",
                    "aid" : "1234",
                    "roundId" : 1384309800
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_scheduled_test_path_vis_results(

            test_id=test_id,

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            cursor=cursor,

            _headers=self.te_headers("get_scheduled_test_path_vis_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_get_scheduled_test_path_vis_results_error_401(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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_scheduled_test_path_vis_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                _headers=self.te_headers("get_scheduled_test_path_vis_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_results_error_403(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.get_scheduled_test_path_vis_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                _headers=self.te_headers("get_scheduled_test_path_vis_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_results_error_404(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.get_scheduled_test_path_vis_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                _headers=self.te_headers("get_scheduled_test_path_vis_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_results_error_429(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.get_scheduled_test_path_vis_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                _headers=self.te_headers("get_scheduled_test_path_vis_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_results_error_500(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.get_scheduled_test_path_vis_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                _headers=self.te_headers("get_scheduled_test_path_vis_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_scheduled_test_path_vis_results_error_502(self) -> None:
        """Integration test for get_scheduled_test_path_vis_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" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.get_scheduled_test_path_vis_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                _headers=self.te_headers("get_scheduled_test_path_vis_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)






if __name__ == '__main__':
    unittest.main()
