Skip to content

Commit af8aa42

Browse files
committed
convert uid strings in the from_params data to remove braces before comparison
1 parent e132ff7 commit af8aa42

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

tests/uijson_test.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,18 @@ def test_gravity_uijson(tmp_path):
9898
with open(uijson_path, encoding="utf-8") as f:
9999
uijson_data = json.load(f)
100100

101-
assert uijson_data == params_data
101+
params_data_nobraces = {}
102+
for param, data in params_data.items():
103+
if isinstance(data, dict):
104+
field_data_nobraces = {}
105+
for field, value in data.items():
106+
if isinstance(value, str):
107+
value = value.removeprefix("{").removesuffix("}")
108+
if isinstance(value, list):
109+
value = [v.removeprefix("{").removesuffix("}") for v in value]
110+
field_data_nobraces[field] = value
111+
else:
112+
field_data_nobraces = data
113+
params_data_nobraces[param] = field_data_nobraces
114+
115+
assert uijson_data == params_data_nobraces

0 commit comments

Comments
 (0)