Skip to content

Commit 9c81a44

Browse files
authored
Merge pull request #144 from Geode-solutions/next
Next
2 parents 0770926 + b6ad75b commit 9c81a44

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# CHANGELOG
22

33

4+
## v5.7.2-rc.1 (2025-05-19)
5+
6+
### Bug Fixes
7+
8+
- **blueprint_models**: Change getroot to find & rm current_index from the if
9+
([`3ddcf96`](https://github.com/Geode-solutions/OpenGeodeWeb-Back/commit/3ddcf96fff539f273542da63f6091f654e892ad1))
10+
11+
412
## v5.7.1 (2025-05-07)
513

614

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55

66
[project]
77
name = "OpenGeodeWeb-Back"
8-
version = "5.7.1"
8+
version = "5.7.2-rc.1"
99
dynamic = ["dependencies"]
1010
authors = [
1111
{ name="Geode-solutions", email="[email protected]" },

src/opengeodeweb_back/routes/models/blueprint_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ def uuid_to_flat_index():
2525
)
2626

2727
tree = ET.parse(vtm_file_path)
28-
root = tree.getroot()
28+
root = tree.find("vtkMultiBlockDataSet")
2929
uuid_to_flat_index = {}
3030
current_index = 1
3131

3232
for elem in root.iter():
3333
if "uuid" in elem.attrib and elem.tag == "DataSet":
3434
uuid_to_flat_index[elem.attrib["uuid"]] = current_index
35-
current_index += 1
35+
current_index += 1
3636

3737
return flask.make_response(
3838
{"uuid_to_flat_index": uuid_to_flat_index},

tests/test_models_routes.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ def test_model_mesh_components(client):
44
json = get_full_data()
55
response = client.post(route, json=json)
66
assert response.status_code == 200
7+
78
uuid_dict = response.json["uuid_to_flat_index"]
8-
assert type(uuid_dict) is dict
9+
assert isinstance(uuid_dict, dict)
910

1011
indices = list(uuid_dict.values())
1112
indices.sort()
12-
assert indices[0] == 1
13-
assert all(indices[i] == indices[i - 1] + 1 for i in range(1, len(indices)))
13+
assert all(indices[i] > indices[i - 1] for i in range(1, len(indices)))
14+
for uuid in uuid_dict.keys():
15+
assert isinstance(uuid, str)
1416

1517

1618
def test_extract_brep_uuids(client):
1719
route = "/models/mesh_components"
1820
json_data = {"filename": "cube.og_brep", "geode_object": "BRep"}
19-
2021
response = client.post(route, json=json_data)
2122

2223
assert response.status_code == 200
2324
uuid_dict = response.json["uuid_dict"]
2425
assert isinstance(uuid_dict, dict)
25-
assert (
26-
"Block" in uuid_dict
27-
or "Line" in uuid_dict
28-
or "Surface" in uuid_dict
29-
or "Corner" in uuid_dict
30-
)
26+
expected_keys = {"Block", "Line", "Surface", "Corner"}
27+
assert any(key in uuid_dict for key in expected_keys)
28+
for key, value in uuid_dict.items():
29+
assert isinstance(value, list)
30+
assert all(isinstance(v, str) for v in value)

0 commit comments

Comments
 (0)