Skip to content

Commit 0eee532

Browse files
committed
Merge branch 'feat/input_file' of https://github.com/Geode-solutions/OpenGeodeWeb-Back into feat/input_file
2 parents ebf438f + 222b0bb commit 0eee532

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/opengeodeweb_back/utils_functions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def handle_exception(e):
143143
response.content_type = "application/json"
144144
return response
145145

146+
146147
def generate_native_viewable_and_light_viewable_from_object(geode_object, data):
147148
generated_id = str(uuid.uuid4()).replace("-", "")
148149
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
@@ -180,6 +181,7 @@ def generate_native_viewable_and_light_viewable_from_object(geode_object, data):
180181
}
181182
return result
182183

184+
183185
def generate_native_viewable_and_light_viewable_from_file(geode_object, input_filename):
184186
generated_id = str(uuid.uuid4()).replace("-", "")
185187
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
@@ -195,7 +197,9 @@ def generate_native_viewable_and_light_viewable_from_file(geode_object, input_fi
195197
for additional_file in additional.mandatory_files + additional.optional_files:
196198
if additional_file.is_missing:
197199
continue
198-
source_path = os.path.join(os.path.dirname(input_filename), additional_file.filename)
200+
source_path = os.path.join(
201+
os.path.dirname(input_filename), additional_file.filename
202+
)
199203
if not os.path.exists(source_path):
200204
continue
201205
dest_path = os.path.join(data_path, additional_file.filename)

tests/test_utils_functions.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,17 @@ def test_handle_exception(client):
7070
assert type(data["name"]) is str
7171
assert type(data["code"]) is int
7272

73+
7374
def test_generate_native_viewable_and_light_viewable_from_object(client):
7475
app = client.application
7576
with app.app_context():
7677
geode_object = "BRep"
7778
data = geode_functions.load(geode_object, "./tests/data/test.og_brep")
7879

79-
result = utils_functions.generate_native_viewable_and_light_viewable_from_object(
80-
geode_object, data
80+
result = (
81+
utils_functions.generate_native_viewable_and_light_viewable_from_object(
82+
geode_object, data
83+
)
8184
)
8285

8386
assert isinstance(result, dict)

0 commit comments

Comments
 (0)