thousandeyes-sdk-python/thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api.py
api-team-automation[bot] d4b7ca82b7
Some checks failed
Python CI / build (push) Has been cancelled
[GitHub Bot] Generated python SDK (#193)
Co-authored-by: API Team <api-team@thousandeyes.com>
2026-09-08 13:15:25 +01:00

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()