thousandeyes-sdk-python/thousandeyes-sdk-event-detection/test/test_utils.py
Shahid Hussain Khan 09e9385636
Some checks failed
Python CI / build (push) Has been cancelled
Add Event detection API (#43)
* [GitHub Bot] Generated python SDK

* Updated README

---------

Co-authored-by: API Team <api-team@thousandeyes.com>
Co-authored-by: Miguel Pragosa <mpragosa@thousandeyes.com>
2024-08-11 10:21:46 +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)