Skip to content

Commit 4ce8770

Browse files
committed
Merge branch 'fix/database' of https://github.com/Geode-solutions/OpenGeodeWeb-Viewer into fix/database
2 parents 12ee4e5 + 58f182b commit 4ce8770

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

src/opengeodeweb_viewer/config.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ def dev_config():
2424
if not os.path.exists(os.environ.get("DATA_FOLDER_PATH")):
2525
os.mkdir(os.environ.get("DATA_FOLDER_PATH"))
2626

27-
def _copy_test_assets(src_data: str, tmp_data_root: str, test_ids: list[str], valid_exts: set[str], uploads_directory: str, structure_directory: str):
27+
28+
def _copy_test_assets(
29+
src_data: str,
30+
tmp_data_root: str,
31+
test_ids: list[str],
32+
valid_exts: set[str],
33+
uploads_directory: str,
34+
structure_directory: str,
35+
):
2836
for root, directories, files in os.walk(src_data):
2937
for directory in directories:
3038
for test_id in test_ids:
@@ -39,6 +47,7 @@ def _copy_test_assets(src_data: str, tmp_data_root: str, test_ids: list[str], va
3947
copyfile(src, os.path.join(structure_directory, file))
4048
copyfile(src, os.path.join(uploads_directory, file))
4149

50+
4251
def test_config(path):
4352
default_config()
4453

@@ -49,7 +58,15 @@ def test_config(path):
4958
if not os.path.isdir(src_data):
5059
raise FileNotFoundError(f"Test data folder not found: {src_data}")
5160

52-
test_ids = ["123456789", "12345678", "44556677", "22334455", "11223344", "33445566", "33445577"]
61+
test_ids = [
62+
"123456789",
63+
"12345678",
64+
"44556677",
65+
"22334455",
66+
"11223344",
67+
"33445566",
68+
"33445577",
69+
]
5370
valid_exts = {".vtp", ".vti", ".vtu", ".vtm"}
5471

5572
project_uuid = "test-project-uuid"
@@ -80,4 +97,4 @@ def test_config(path):
8097
structure_directory=structure_directory,
8198
)
8299

83-
print(f"\nDATA_FOLDER_PATH set to: {tmp_data_root}", flush=True)
100+
print(f"\nDATA_FOLDER_PATH set to: {tmp_data_root}", flush=True)

src/tests/conftest.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def images_diff(self, first_image_path, second_image_path):
8585

8686
def compare_image(self, filename):
8787
import time
88+
8889
self.ws.settimeout(4.0)
8990
image = None
9091
deadline = time.time() + 12.0
@@ -98,7 +99,9 @@ def compare_image(self, filename):
9899
break
99100
if not isinstance(image, bytes):
100101
return False
101-
test_file_path = os.path.abspath(os.path.join(self.test_output_dir, "test.jpeg"))
102+
test_file_path = os.path.abspath(
103+
os.path.join(self.test_output_dir, "test.jpeg")
104+
)
102105
with open(test_file_path, "wb") as f:
103106
f.write(image)
104107
format = "jpeg"
@@ -112,7 +115,9 @@ def compare_image(self, filename):
112115
pass
113116

114117
if format != "jpeg":
115-
new_path = os.path.abspath(os.path.join(self.test_output_dir, f"test.{format}"))
118+
new_path = os.path.abspath(
119+
os.path.join(self.test_output_dir, f"test.{format}")
120+
)
116121
os.replace(test_file_path, new_path)
117122
test_file_path = new_path
118123

@@ -354,7 +359,9 @@ def _copy_asset(fname: str):
354359
row.native_file_name = native_file_name or row.native_file_name
355360
row.viewable_file_name = viewable_file_name or row.viewable_file_name
356361
row.geode_object = geode_object or row.geode_object
357-
row.light_viewable = light_viewable if light_viewable is not None else row.light_viewable
362+
row.light_viewable = (
363+
light_viewable if light_viewable is not None else row.light_viewable
364+
)
358365
row.input_file = input_file or row.input_file
359366
row.additional_files = additional_files or row.additional_files
360367
return id

src/tests/mesh/points/test_mesh_points_protocols.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Local application imports
88
# from src.tests.test_data_helpers import create_mesh_data
99

10+
1011
def test_points_visibility(server):
1112
mesh_id = "123456789"
1213
server.call(

src/tests/test_generic_protocols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ def test_deregister_model(server):
4343
+ VtkGenericView.generic_schemas_dict["deregister"]["rpc"],
4444
[{"viewer_object": "model", "id": "12345678"}],
4545
)
46-
assert server.compare_image(3, "model/deregister.jpeg") == True
46+
assert server.compare_image(3, "model/deregister.jpeg") == True

0 commit comments

Comments
 (0)