# coding: utf-8

"""
    Endpoint Tests API

    Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. 

    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import json
import unittest
import thousandeyes_sdk.endpoint_tests.models

from thousandeyes_sdk.core.exceptions import ApiException
from thousandeyes_sdk.endpoint_tests.api.http_server_endpoint_scheduled_tests_api import HTTPServerEndpointScheduledTestsApi
from .integration_test_utils import IntegrationTestBase
from .test_utils import assert_constructed_model_matches_example_json


class TestHTTPServerEndpointScheduledTestsApiIntegration(IntegrationTestBase):
    """HTTPServerEndpointScheduledTestsApi integration test stubs"""

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


    def test_create_http_server_endpoint_scheduled_test_happy_path(self) -> None:
        """Integration test for create_http_server_endpoint_scheduled_test success path"""
        request_body_json = """
        
                {
                  "verifyCertificate" : true,
                  "hasPing" : true,
                  "agentSelectorType" : "all-agents",
                  "tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
                  "maxMachines" : 25,
                  "isPrioritized" : false,
                  "httpTimeLimit" : 5000,
                  "networkMeasurements" : true,
                  "endpointAgentLabels" : [ "567", "214" ],
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
                  "protocol" : "icmp",
                  "password" : "password",
                  "ipVersion" : "V4_ONLY",
                  "hasTraceroute" : true,
                  "targetResponseTime" : 1000,
                  "interval" : 60,
                  "authType" : "none",
                  "hasPathTraceInSession" : true,
                  "testName" : "Test name",
                  "username" : "username",
                  "sslVersionId" : "0"
                }
        
                """
        endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json)
        aid = '1234'
        response_body_json = """
                {
                  "server" : "www.example.com",
                  "isSavedEvent" : false,
                  "sslVersion" : "Auto",
                  "useNtlm" : 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,
                  "httpTimeLimit" : 5000,
                  "type" : "http-server",
                  "protocol" : "icmp",
                  "httpVersion" : 2,
                  "followRedirects" : true,
                  "authType" : "none",
                  "testName" : "Test name",
                  "verifyCertificate" : true,
                  "networkMeasurements" : true,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "labels" : [ {
                    "labelId" : "961",
                    "name" : "Artem label",
                    "isBuiltin" : false
                  }, {
                    "labelId" : "961",
                    "name" : "Artem label",
                    "isBuiltin" : false
                  } ],
                  "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,
                  "httpTargetTime" : 100,
                  "username" : "username",
                  "sslVersionId" : "0"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.create_http_server_endpoint_scheduled_test(

            endpoint_http_server_test_request=endpoint_http_server_test_request,

            aid=aid,

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


    def test_create_http_server_endpoint_scheduled_test_error_400(self) -> None:
        """Integration test for create_http_server_endpoint_scheduled_test error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "verifyCertificate" : true,
                  "hasPing" : true,
                  "agentSelectorType" : "all-agents",
                  "tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
                  "maxMachines" : 25,
                  "isPrioritized" : false,
                  "httpTimeLimit" : 5000,
                  "networkMeasurements" : true,
                  "endpointAgentLabels" : [ "567", "214" ],
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
                  "protocol" : "icmp",
                  "password" : "password",
                  "ipVersion" : "V4_ONLY",
                  "hasTraceroute" : true,
                  "targetResponseTime" : 1000,
                  "interval" : 60,
                  "authType" : "none",
                  "hasPathTraceInSession" : true,
                  "testName" : "Test name",
                  "username" : "username",
                  "sslVersionId" : "0"
                }
        
                """
        endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json)
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "errors" : [ {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  }, {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  } ],
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(400)
        ) as context:
            self.api.create_http_server_endpoint_scheduled_test(

                endpoint_http_server_test_request=endpoint_http_server_test_request,

                aid=aid,

                _headers=self.te_headers("create_http_server_endpoint_scheduled_test", error_status="400"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_create_http_server_endpoint_scheduled_test_error_401(self) -> None:
        """Integration test for create_http_server_endpoint_scheduled_test error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "verifyCertificate" : true,
                  "hasPing" : true,
                  "agentSelectorType" : "all-agents",
                  "tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
                  "maxMachines" : 25,
                  "isPrioritized" : false,
                  "httpTimeLimit" : 5000,
                  "networkMeasurements" : true,
                  "endpointAgentLabels" : [ "567", "214" ],
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
                  "protocol" : "icmp",
                  "password" : "password",
                  "ipVersion" : "V4_ONLY",
                  "hasTraceroute" : true,
                  "targetResponseTime" : 1000,
                  "interval" : 60,
                  "authType" : "none",
                  "hasPathTraceInSession" : true,
                  "testName" : "Test name",
                  "username" : "username",
                  "sslVersionId" : "0"
                }
        
                """
        endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json)
        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.create_http_server_endpoint_scheduled_test(

                endpoint_http_server_test_request=endpoint_http_server_test_request,

                aid=aid,

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


    def test_create_http_server_endpoint_scheduled_test_error_403(self) -> None:
        """Integration test for create_http_server_endpoint_scheduled_test error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "verifyCertificate" : true,
                  "hasPing" : true,
                  "agentSelectorType" : "all-agents",
                  "tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
                  "maxMachines" : 25,
                  "isPrioritized" : false,
                  "httpTimeLimit" : 5000,
                  "networkMeasurements" : true,
                  "endpointAgentLabels" : [ "567", "214" ],
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
                  "protocol" : "icmp",
                  "password" : "password",
                  "ipVersion" : "V4_ONLY",
                  "hasTraceroute" : true,
                  "targetResponseTime" : 1000,
                  "interval" : 60,
                  "authType" : "none",
                  "hasPathTraceInSession" : true,
                  "testName" : "Test name",
                  "username" : "username",
                  "sslVersionId" : "0"
                }
        
                """
        endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json)
        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.create_http_server_endpoint_scheduled_test(

                endpoint_http_server_test_request=endpoint_http_server_test_request,

                aid=aid,

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


    def test_create_http_server_endpoint_scheduled_test_error_404(self) -> None:
        """Integration test for create_http_server_endpoint_scheduled_test error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "verifyCertificate" : true,
                  "hasPing" : true,
                  "agentSelectorType" : "all-agents",
                  "tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
                  "maxMachines" : 25,
                  "isPrioritized" : false,
                  "httpTimeLimit" : 5000,
                  "networkMeasurements" : true,
                  "endpointAgentLabels" : [ "567", "214" ],
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
                  "protocol" : "icmp",
                  "password" : "password",
                  "ipVersion" : "V4_ONLY",
                  "hasTraceroute" : true,
                  "targetResponseTime" : 1000,
                  "interval" : 60,
                  "authType" : "none",
                  "hasPathTraceInSession" : true,
                  "testName" : "Test name",
                  "username" : "username",
                  "sslVersionId" : "0"
                }
        
                """
        endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json)
        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.create_http_server_endpoint_scheduled_test(

                endpoint_http_server_test_request=endpoint_http_server_test_request,

                aid=aid,

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


    def test_create_http_server_endpoint_scheduled_test_error_429(self) -> None:
        """Integration test for create_http_server_endpoint_scheduled_test error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "verifyCertificate" : true,
                  "hasPing" : true,
                  "agentSelectorType" : "all-agents",
                  "tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
                  "maxMachines" : 25,
                  "isPrioritized" : false,
                  "httpTimeLimit" : 5000,
                  "networkMeasurements" : true,
                  "endpointAgentLabels" : [ "567", "214" ],
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
                  "protocol" : "icmp",
                  "password" : "password",
                  "ipVersion" : "V4_ONLY",
                  "hasTraceroute" : true,
                  "targetResponseTime" : 1000,
                  "interval" : 60,
                  "authType" : "none",
                  "hasPathTraceInSession" : true,
                  "testName" : "Test name",
                  "username" : "username",
                  "sslVersionId" : "0"
                }
        
                """
        endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json)
        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.create_http_server_endpoint_scheduled_test(

                endpoint_http_server_test_request=endpoint_http_server_test_request,

                aid=aid,

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


    def test_create_http_server_endpoint_scheduled_test_error_500(self) -> None:
        """Integration test for create_http_server_endpoint_scheduled_test error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "verifyCertificate" : true,
                  "hasPing" : true,
                  "agentSelectorType" : "all-agents",
                  "tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
                  "maxMachines" : 25,
                  "isPrioritized" : false,
                  "httpTimeLimit" : 5000,
                  "networkMeasurements" : true,
                  "endpointAgentLabels" : [ "567", "214" ],
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
                  "protocol" : "icmp",
                  "password" : "password",
                  "ipVersion" : "V4_ONLY",
                  "hasTraceroute" : true,
                  "targetResponseTime" : 1000,
                  "interval" : 60,
                  "authType" : "none",
                  "hasPathTraceInSession" : true,
                  "testName" : "Test name",
                  "username" : "username",
                  "sslVersionId" : "0"
                }
        
                """
        endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json)
        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.create_http_server_endpoint_scheduled_test(

                endpoint_http_server_test_request=endpoint_http_server_test_request,

                aid=aid,

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


    def test_create_http_server_endpoint_scheduled_test_error_502(self) -> None:
        """Integration test for create_http_server_endpoint_scheduled_test error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "verifyCertificate" : true,
                  "hasPing" : true,
                  "agentSelectorType" : "all-agents",
                  "tagIds" : [ "c6b78e57-81a2-4c5f-a11a-d96c3c664d55", "5aeab5d5-0d34-4d44-a7ac-fb440185295c" ],
                  "maxMachines" : 25,
                  "isPrioritized" : false,
                  "httpTimeLimit" : 5000,
                  "networkMeasurements" : true,
                  "endpointAgentLabels" : [ "567", "214" ],
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "agents" : [ "0a3b9998-dc3a-4ff2-b50d-ac4a7cd986e1", "66eec0f1-72b4-4755-aa83-3aed61d17f3c" ],
                  "protocol" : "icmp",
                  "password" : "password",
                  "ipVersion" : "V4_ONLY",
                  "hasTraceroute" : true,
                  "targetResponseTime" : 1000,
                  "interval" : 60,
                  "authType" : "none",
                  "hasPathTraceInSession" : true,
                  "testName" : "Test name",
                  "username" : "username",
                  "sslVersionId" : "0"
                }
        
                """
        endpoint_http_server_test_request = thousandeyes_sdk.endpoint_tests.models.EndpointHttpServerTestRequest.from_json(request_body_json)
        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.create_http_server_endpoint_scheduled_test(

                endpoint_http_server_test_request=endpoint_http_server_test_request,

                aid=aid,

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




    def test_delete_http_server_endpoint_scheduled_test_happy_path(self) -> None:
        """Integration test for delete_http_server_endpoint_scheduled_test success path"""
        test_id = '584739201'
        aid = '1234'
        response = self.api.delete_http_server_endpoint_scheduled_test_with_http_info(

            test_id=test_id,

            aid=aid,

            _headers=self.te_headers("delete_http_server_endpoint_scheduled_test"),
        )
        self.assertEqual(204, response.status_code)
        self.assertIsNone(response.data)


    def test_delete_http_server_endpoint_scheduled_test_error_400(self) -> None:
        """Integration test for delete_http_server_endpoint_scheduled_test error path (HTTP 400)"""
        test_id = '584739201'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "errors" : [ {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  }, {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  } ],
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(400)
        ) as context:
            self.api.delete_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

                _headers=self.te_headers("delete_http_server_endpoint_scheduled_test", error_status="400"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_delete_http_server_endpoint_scheduled_test_error_401(self) -> None:
        """Integration test for delete_http_server_endpoint_scheduled_test error path (HTTP 401)"""
        test_id = '584739201'
        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.delete_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_delete_http_server_endpoint_scheduled_test_error_403(self) -> None:
        """Integration test for delete_http_server_endpoint_scheduled_test error path (HTTP 403)"""
        test_id = '584739201'
        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.delete_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_delete_http_server_endpoint_scheduled_test_error_404(self) -> None:
        """Integration test for delete_http_server_endpoint_scheduled_test error path (HTTP 404)"""
        test_id = '584739201'
        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.delete_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_delete_http_server_endpoint_scheduled_test_error_429(self) -> None:
        """Integration test for delete_http_server_endpoint_scheduled_test error path (HTTP 429)"""
        test_id = '584739201'
        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.delete_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_delete_http_server_endpoint_scheduled_test_error_500(self) -> None:
        """Integration test for delete_http_server_endpoint_scheduled_test error path (HTTP 500)"""
        test_id = '584739201'
        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.delete_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_delete_http_server_endpoint_scheduled_test_error_502(self) -> None:
        """Integration test for delete_http_server_endpoint_scheduled_test error path (HTTP 502)"""
        test_id = '584739201'
        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.delete_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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




    def test_get_http_server_endpoint_scheduled_test_happy_path(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_test success path"""
        test_id = '584739201'
        aid = '1234'
        response_body_json = """
                {
                  "server" : "www.example.com",
                  "isSavedEvent" : false,
                  "sslVersion" : "Auto",
                  "useNtlm" : 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,
                  "httpTimeLimit" : 5000,
                  "type" : "http-server",
                  "protocol" : "icmp",
                  "httpVersion" : 2,
                  "followRedirects" : true,
                  "authType" : "none",
                  "testName" : "Test name",
                  "verifyCertificate" : true,
                  "networkMeasurements" : true,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "labels" : [ {
                    "labelId" : "961",
                    "name" : "Artem label",
                    "isBuiltin" : false
                  }, {
                    "labelId" : "961",
                    "name" : "Artem label",
                    "isBuiltin" : false
                  } ],
                  "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,
                  "httpTargetTime" : 100,
                  "username" : "username",
                  "sslVersionId" : "0"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_http_server_endpoint_scheduled_test(

            test_id=test_id,

            aid=aid,

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


    def test_get_http_server_endpoint_scheduled_test_error_401(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_test error path (HTTP 401)"""
        test_id = '584739201'
        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_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_test_error_403(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_test error path (HTTP 403)"""
        test_id = '584739201'
        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_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_test_error_404(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_test error path (HTTP 404)"""
        test_id = '584739201'
        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_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_test_error_429(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_test error path (HTTP 429)"""
        test_id = '584739201'
        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_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_test_error_500(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_test error path (HTTP 500)"""
        test_id = '584739201'
        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_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_test_error_502(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_test error path (HTTP 502)"""
        test_id = '584739201'
        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_http_server_endpoint_scheduled_test(

                test_id=test_id,

                aid=aid,

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




    def test_get_http_server_endpoint_scheduled_tests_happy_path(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_tests success path"""
        aid = '1234'
        response_body_json = """
                {
                  "tests" : [ {
                    "server" : "www.example.com",
                    "isSavedEvent" : false,
                    "sslVersion" : "Auto",
                    "useNtlm" : 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,
                    "httpTimeLimit" : 5000,
                    "type" : "http-server",
                    "protocol" : "icmp",
                    "httpVersion" : 2,
                    "followRedirects" : true,
                    "authType" : "none",
                    "testName" : "Test name",
                    "verifyCertificate" : true,
                    "networkMeasurements" : true,
                    "tcpProbeMode" : "auto",
                    "url" : "https://example.com:443",
                    "labels" : [ {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    }, {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    } ],
                    "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,
                    "httpTargetTime" : 100,
                    "username" : "username",
                    "sslVersionId" : "0"
                  }, {
                    "server" : "www.example.com",
                    "isSavedEvent" : false,
                    "sslVersion" : "Auto",
                    "useNtlm" : 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,
                    "httpTimeLimit" : 5000,
                    "type" : "http-server",
                    "protocol" : "icmp",
                    "httpVersion" : 2,
                    "followRedirects" : true,
                    "authType" : "none",
                    "testName" : "Test name",
                    "verifyCertificate" : true,
                    "networkMeasurements" : true,
                    "tcpProbeMode" : "auto",
                    "url" : "https://example.com:443",
                    "labels" : [ {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    }, {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    } ],
                    "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,
                    "httpTargetTime" : 100,
                    "username" : "username",
                    "sslVersionId" : "0"
                  } ],
                  "_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"
                    }
                  }
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_http_server_endpoint_scheduled_tests(

            aid=aid,

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


    def test_get_http_server_endpoint_scheduled_tests_error_401(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_tests error path (HTTP 401)"""
        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_http_server_endpoint_scheduled_tests(

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_tests_error_403(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_tests error path (HTTP 403)"""
        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_http_server_endpoint_scheduled_tests(

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_tests_error_429(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_tests error path (HTTP 429)"""
        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_http_server_endpoint_scheduled_tests(

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_tests_error_500(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_tests error path (HTTP 500)"""
        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_http_server_endpoint_scheduled_tests(

                aid=aid,

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


    def test_get_http_server_endpoint_scheduled_tests_error_502(self) -> None:
        """Integration test for get_http_server_endpoint_scheduled_tests error path (HTTP 502)"""
        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_http_server_endpoint_scheduled_tests(

                aid=aid,

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




    def test_update_http_server_endpoint_scheduled_test_happy_path(self) -> None:
        """Integration test for update_http_server_endpoint_scheduled_test success path"""
        request_body_json = """
        
                {
                  "protocol" : "icmp",
                  "isEnabled" : true,
                  "interval" : 60,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "testName" : "Test name"
                }
        
                """
        endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json)
        test_id = '584739201'
        aid = '1234'
        response_body_json = """
                {
                  "server" : "www.example.com",
                  "isSavedEvent" : false,
                  "sslVersion" : "Auto",
                  "useNtlm" : 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,
                  "httpTimeLimit" : 5000,
                  "type" : "http-server",
                  "protocol" : "icmp",
                  "httpVersion" : 2,
                  "followRedirects" : true,
                  "authType" : "none",
                  "testName" : "Test name",
                  "verifyCertificate" : true,
                  "networkMeasurements" : true,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "labels" : [ {
                    "labelId" : "961",
                    "name" : "Artem label",
                    "isBuiltin" : false
                  }, {
                    "labelId" : "961",
                    "name" : "Artem label",
                    "isBuiltin" : false
                  } ],
                  "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,
                  "httpTargetTime" : 100,
                  "username" : "username",
                  "sslVersionId" : "0"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.update_http_server_endpoint_scheduled_test(

            test_id=test_id,

            endpoint_http_test_update=endpoint_http_test_update,

            aid=aid,

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


    def test_update_http_server_endpoint_scheduled_test_error_400(self) -> None:
        """Integration test for update_http_server_endpoint_scheduled_test error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "protocol" : "icmp",
                  "isEnabled" : true,
                  "interval" : 60,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "testName" : "Test name"
                }
        
                """
        endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json)
        test_id = '584739201'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "errors" : [ {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  }, {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  } ],
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(400)
        ) as context:
            self.api.update_http_server_endpoint_scheduled_test(

                test_id=test_id,

                endpoint_http_test_update=endpoint_http_test_update,

                aid=aid,

                _headers=self.te_headers("update_http_server_endpoint_scheduled_test", error_status="400"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_update_http_server_endpoint_scheduled_test_error_401(self) -> None:
        """Integration test for update_http_server_endpoint_scheduled_test error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "protocol" : "icmp",
                  "isEnabled" : true,
                  "interval" : 60,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "testName" : "Test name"
                }
        
                """
        endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json)
        test_id = '584739201'
        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.update_http_server_endpoint_scheduled_test(

                test_id=test_id,

                endpoint_http_test_update=endpoint_http_test_update,

                aid=aid,

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


    def test_update_http_server_endpoint_scheduled_test_error_403(self) -> None:
        """Integration test for update_http_server_endpoint_scheduled_test error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "protocol" : "icmp",
                  "isEnabled" : true,
                  "interval" : 60,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "testName" : "Test name"
                }
        
                """
        endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json)
        test_id = '584739201'
        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.update_http_server_endpoint_scheduled_test(

                test_id=test_id,

                endpoint_http_test_update=endpoint_http_test_update,

                aid=aid,

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


    def test_update_http_server_endpoint_scheduled_test_error_404(self) -> None:
        """Integration test for update_http_server_endpoint_scheduled_test error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "protocol" : "icmp",
                  "isEnabled" : true,
                  "interval" : 60,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "testName" : "Test name"
                }
        
                """
        endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json)
        test_id = '584739201'
        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.update_http_server_endpoint_scheduled_test(

                test_id=test_id,

                endpoint_http_test_update=endpoint_http_test_update,

                aid=aid,

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


    def test_update_http_server_endpoint_scheduled_test_error_429(self) -> None:
        """Integration test for update_http_server_endpoint_scheduled_test error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "protocol" : "icmp",
                  "isEnabled" : true,
                  "interval" : 60,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "testName" : "Test name"
                }
        
                """
        endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json)
        test_id = '584739201'
        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.update_http_server_endpoint_scheduled_test(

                test_id=test_id,

                endpoint_http_test_update=endpoint_http_test_update,

                aid=aid,

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


    def test_update_http_server_endpoint_scheduled_test_error_500(self) -> None:
        """Integration test for update_http_server_endpoint_scheduled_test error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "protocol" : "icmp",
                  "isEnabled" : true,
                  "interval" : 60,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "testName" : "Test name"
                }
        
                """
        endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json)
        test_id = '584739201'
        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.update_http_server_endpoint_scheduled_test(

                test_id=test_id,

                endpoint_http_test_update=endpoint_http_test_update,

                aid=aid,

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


    def test_update_http_server_endpoint_scheduled_test_error_502(self) -> None:
        """Integration test for update_http_server_endpoint_scheduled_test error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "protocol" : "icmp",
                  "isEnabled" : true,
                  "interval" : 60,
                  "tcpProbeMode" : "auto",
                  "url" : "https://example.com:443",
                  "testName" : "Test name"
                }
        
                """
        endpoint_http_test_update = thousandeyes_sdk.endpoint_tests.models.EndpointHttpTestUpdate.from_json(request_body_json)
        test_id = '584739201'
        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.update_http_server_endpoint_scheduled_test(

                test_id=test_id,

                endpoint_http_test_update=endpoint_http_test_update,

                aid=aid,

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






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