thousandeyes-sdk-python/thousandeyes-sdk-labels/test/test_all_labels_api.py
2024-07-26 15:58:29 +00:00

69 lines
2.0 KiB
Python

# coding: utf-8
"""
Labels API
### Overview This is API for the Labels API (formerly called groups).
The version of the OpenAPI document: 7.0.11
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import json
import unittest
import thousandeyes_sdk.labels.models
from .test_utils import assert_constructed_model_matches_example_json
from thousandeyes_sdk.labels.api.all_labels_api import AllLabelsApi
class TestAllLabelsApi(unittest.TestCase):
"""AllLabelsApi unit test stubs"""
def setUp(self) -> None:
self.api = AllLabelsApi()
def tearDown(self) -> None:
pass
def test_get_labels_models_validation(self) -> None:
"""Test case for get_labels request and response models"""
response_body_json = """
{
"_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"
}
},
"labels" : [ {
"labelId" : "961123",
"name" : "Label XYZ",
"isBuiltIn" : true,
"type" : "endpoint-test"
}, {
"labelId" : "961123",
"name" : "Label XYZ",
"isBuiltIn" : true,
"type" : "endpoint-test"
} ]
}"""
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.labels.models.Labels.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':
unittest.main()