Skip to content

Commit bf2c1fe

Browse files
committed
Bring back test
1 parent a43fd83 commit bf2c1fe

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

tests/uijson_test.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,23 @@ def test_gravity_uijson(tmp_path):
9393
uijson = GravityInversionUIJson.read(params_uijson_path)
9494
uijson_path = tmp_path / "from_uijson.ui.json"
9595
uijson.write(uijson_path)
96-
# with open(params_uijson_path, encoding="utf-8") as f:
97-
# params_data = json.load(f)
98-
# with open(uijson_path, encoding="utf-8") as f:
99-
# uijson_data = json.load(f)
100-
#
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
96+
with open(params_uijson_path, encoding="utf-8") as f:
97+
params_data = json.load(f)
98+
with open(uijson_path, encoding="utf-8") as f:
99+
uijson_data = json.load(f)
100+
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)