Files
Shortumation/api/tests/unittests/test_json_serializer.py
T
2022-05-20 12:33:25 -04:00

32 lines
924 B
Python

import json
from unittest import TestCase
from src.json_serializer import json_dumps
from src.yaml_serializer.types import NOT_IMPLEMENTED_SV_MSG, SecretValue
class json_serializer_tests(TestCase):
def test_convert_secret_value(self):
self.assertEqual(
json_dumps(
{
"int": 1,
"float": 1.3,
"bool": False,
"list": [1, "w"],
"tup": (1, "w"),
"some": {"deep": {"obj": SecretValue("super", "sec")}},
}
),
json.dumps(
{
"int": 1,
"float": 1.3,
"bool": False,
"list": [1, "w"],
"tup": (1, "w"),
"some": {"deep": {"obj": NOT_IMPLEMENTED_SV_MSG}},
},
),
)