thousandeyes-sdk-python/thousandeyes-sdk-emulation/test/test_utils.py
Shahid Hussain Khan 9c9b350344
[GitHub Bot] Generated python SDK (#40)
* [GitHub Bot] Generated python SDK

* Deleted labels (that's deprecated in v7, being replaced by tags) & Updated some additional files

---------

Co-authored-by: API Team <api-team@thousandeyes.com>
Co-authored-by: Miguel Pragosa <mpragosa@thousandeyes.com>
2024-08-08 09:31:01 +01:00

17 lines
531 B
Python

# coding: utf-8
import json
import unittest
from pydantic import BaseModel
def assert_constructed_model_matches_example_json(model: BaseModel, loaded_json: dict):
test_case = unittest.TestCase()
test_case.maxDiff = None
test_case.assertIsNotNone(model)
constructed_json = json.loads(model.to_json())
sorted_loaded_json = json.dumps(loaded_json, sort_keys=True)
sorted_constructed_json = json.dumps(constructed_json, sort_keys=True)
test_case.assertEqual(sorted_loaded_json, sorted_constructed_json)