Skip to content

Commit d47f8d4

Browse files
committed
test cube.test.og_brep
1 parent b8b35ee commit d47f8d4

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/opengeodeweb_back/utils_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,5 +333,5 @@ def generate_native_viewable_and_light_viewable_from_file(
333333
data_path = create_data_folder_from_id(data.id)
334334
full_input_filename = geode_functions.upload_file_path(input_file)
335335
geode_object = generic_geode_object.load(full_input_filename)
336-
geode_object.builder().set_name(os.path.splitext(input_file)[0])
336+
geode_object.builder().set_name(input_file.split(".")[0])
337337
return save_all_viewables_and_return_info(geode_object, data, data_path)

tests/data/cube.test.og_brep

463 KB
Binary file not shown.

tests/test_utils_functions.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,17 @@ def test_generate_native_viewable_and_light_viewable_from_file(
218218
assert isinstance(result["binary_light_viewable"], str)
219219

220220

221+
def test_generate_native_viewable_and_light_viewable_from_file_with_multi_dots(
222+
client: FlaskClient,
223+
) -> None:
224+
app = client.application
225+
with app.app_context():
226+
result = utils_functions.generate_native_viewable_and_light_viewable_from_file(
227+
GeodeBRep.geode_object_type(), "cube.test.og_brep"
228+
)
229+
assert result["name"] == "cube"
230+
231+
221232
def test_send_file_multiple_returns_zip(client: FlaskClient, tmp_path: Path) -> None:
222233
app = client.application
223234
with app.app_context():

0 commit comments

Comments
 (0)