thousandeyes-sdk-python/thousandeyes-sdk-labels/test/test_dashboard_api.py
Shahid Hussain Khan d10dffc0a2
[GitHub Bot] Generated python SDK (#39)
Co-authored-by: API Team <api-team@thousandeyes.com>
2024-08-02 10:04:08 +01:00

175 lines
6.6 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.13
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.dashboard_api import DashboardApi
class TestDashboardApi(unittest.TestCase):
"""DashboardApi unit test stubs"""
def setUp(self) -> None:
self.api = DashboardApi()
def tearDown(self) -> None:
pass
def test_create_dashboard_label_models_validation(self) -> None:
"""Test case for create_dashboard_label request and response models"""
request_body_json = """
{
"name" : "My new label",
"ids" : [ "5048", "1234" ]
}"""
request_loaded_json = json.loads(request_body_json)
request_from_json = thousandeyes_sdk.labels.models.LabelRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"labelId" : "961123",
"_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"
}
},
"name" : "Label XYZ",
"ids" : [ "231286", "6317a3ca0d2bfc6ab882d6ce", "6317a3ca0d2bfc6ab882d6ca" ],
"isBuiltIn" : true,
"type" : "endpoint-test"
}"""
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.labels.models.LabelDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_delete_dashboard_label_models_validation(self) -> None:
"""Test case for delete_dashboard_label request and response models"""
def test_get_dashboard_label_models_validation(self) -> None:
"""Test case for get_dashboard_label request and response models"""
response_body_json = """
{
"labelId" : "961123",
"_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"
}
},
"name" : "Label XYZ",
"ids" : [ "231286", "6317a3ca0d2bfc6ab882d6ce", "6317a3ca0d2bfc6ab882d6ca" ],
"isBuiltIn" : true,
"type" : "endpoint-test"
}"""
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.labels.models.LabelDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_dashboard_labels_models_validation(self) -> None:
"""Test case for get_dashboard_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)
def test_update_dashboard_label_models_validation(self) -> None:
"""Test case for update_dashboard_label request and response models"""
request_body_json = """
{
"name" : "My new label",
"ids" : [ "5048", "1234" ]
}"""
request_loaded_json = json.loads(request_body_json)
request_from_json = thousandeyes_sdk.labels.models.LabelRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"labelId" : "961123",
"_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"
}
},
"name" : "Label XYZ",
"ids" : [ "231286", "6317a3ca0d2bfc6ab882d6ce", "6317a3ca0d2bfc6ab882d6ca" ],
"isBuiltIn" : true,
"type" : "endpoint-test"
}"""
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.labels.models.LabelDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':
unittest.main()