Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ werkzeug==3.1.2
# flask
# flask-cors

opengeodeweb-microservice==1.*,>=1.1.1
2 changes: 1 addition & 1 deletion src/opengeodeweb_back/utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,5 +333,5 @@ def generate_native_viewable_and_light_viewable_from_file(
data_path = create_data_folder_from_id(data.id)
full_input_filename = geode_functions.upload_file_path(input_file)
geode_object = generic_geode_object.load(full_input_filename)
geode_object.builder().set_name(input_file)
geode_object.builder().set_name(os.path.splitext(input_file)[0])
return save_all_viewables_and_return_info(geode_object, data, data_path)
Binary file added tests/data/cube.test.og_brep
Binary file not shown.
12 changes: 12 additions & 0 deletions tests/test_utils_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def test_generate_native_viewable_and_light_viewable_from_file(
)

assert isinstance(result, dict)
assert result["name"] == "test"
assert isinstance(result["native_file"], str)
assert result["native_file"] == "native.og_brep"
assert isinstance(result["viewable_file"], str)
Expand All @@ -217,6 +218,17 @@ def test_generate_native_viewable_and_light_viewable_from_file(
assert isinstance(result["binary_light_viewable"], str)


def test_generate_native_viewable_and_light_viewable_from_file_with_multi_dots(
client: FlaskClient,
) -> None:
app = client.application
with app.app_context():
result = utils_functions.generate_native_viewable_and_light_viewable_from_file(
GeodeBRep.geode_object_type(), "cube.test.og_brep"
)
assert result["name"] == "cube.test"


def test_send_file_multiple_returns_zip(client: FlaskClient, tmp_path: Path) -> None:
app = client.application
with app.app_context():
Expand Down
Loading