mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2026-09-18 07:53:55 +00:00
Some checks failed
Python CI / build (push) Has been cancelled
Co-authored-by: API Team <api-team@thousandeyes.com>
114 lines
4.0 KiB
Python
114 lines
4.0 KiB
Python
# coding: utf-8
|
|
|
|
"""
|
|
BGP Updates API
|
|
|
|
Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group.
|
|
|
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
|
|
Do not edit the class manually.
|
|
""" # noqa: E501
|
|
|
|
|
|
import json
|
|
import unittest
|
|
import thousandeyes_sdk.bgp_updates.models
|
|
|
|
from .test_utils import assert_constructed_model_matches_example_json
|
|
from thousandeyes_sdk.bgp_updates.api.bgp_updates_api import BGPUpdatesApi
|
|
|
|
|
|
class TestBGPUpdatesApi(unittest.TestCase):
|
|
"""BGPUpdatesApi unit test stubs"""
|
|
|
|
def setUp(self) -> None:
|
|
self.api = BGPUpdatesApi()
|
|
|
|
def tearDown(self) -> None:
|
|
pass
|
|
|
|
def test_get_bgp_updates_models_validation(self) -> None:
|
|
"""Test case for get_bgp_updates request and response models"""
|
|
|
|
|
|
response_body_json = """
|
|
{
|
|
"_links" : {
|
|
"next" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
},
|
|
"previous" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
},
|
|
"self" : {
|
|
"hreflang" : "hreflang",
|
|
"templated" : true,
|
|
"profile" : "profile",
|
|
"name" : "name",
|
|
"href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
|
|
"type" : "type",
|
|
"deprecation" : "deprecation",
|
|
"title" : "title"
|
|
}
|
|
},
|
|
"updates" : [ {
|
|
"monitorId" : "101",
|
|
"prefix" : "192.0.2.0/24",
|
|
"asPath" : [ 64512, 64513 ],
|
|
"originAs" : 64512,
|
|
"monitor" : {
|
|
"monitorId" : "101",
|
|
"ipAddress" : "10.0.0.1",
|
|
"asn" : 64512,
|
|
"monitorType" : "private",
|
|
"monitorName" : "Private monitor",
|
|
"countryId" : "US"
|
|
},
|
|
"rpkiStatus" : "Valid",
|
|
"communities" : [ "64512:100" ],
|
|
"updateType" : "announcement",
|
|
"timestamp" : "2024-05-31T16:08:37Z"
|
|
}, {
|
|
"monitorId" : "101",
|
|
"prefix" : "192.0.2.0/24",
|
|
"asPath" : [ 64512, 64513 ],
|
|
"originAs" : 64512,
|
|
"monitor" : {
|
|
"monitorId" : "101",
|
|
"ipAddress" : "10.0.0.1",
|
|
"asn" : 64512,
|
|
"monitorType" : "private",
|
|
"monitorName" : "Private monitor",
|
|
"countryId" : "US"
|
|
},
|
|
"rpkiStatus" : "Valid",
|
|
"communities" : [ "64512:100" ],
|
|
"updateType" : "announcement",
|
|
"timestamp" : "2024-05-31T16:08:37Z"
|
|
} ]
|
|
}"""
|
|
|
|
response_loaded_json = json.loads(response_body_json)
|
|
response_from_json = thousandeyes_sdk.bgp_updates.models.BgpUpdates.from_json(response_body_json)
|
|
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|