Skip to content

Commit 196729b

Browse files
Apply prepare changes
1 parent dd4711f commit 196729b

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

src/opengeodeweb_back/geode_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def geode_object_value(geode_object: str):
1717

1818
def geode_object_class(geode_object: str):
1919
return geode_object_value(geode_object)["class"]
20+
21+
2022
def input_factory(geode_object: str):
2123
return geode_object_value(geode_object)["input_factory"]
2224

@@ -258,4 +260,3 @@ def create_coordinate_system(
258260
create_crs(
259261
geode_object, data, name, input_coordiante_system, output_coordiante_system
260262
)
261-

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def save_viewable_file():
278278
create_point_json = json.load(file)
279279

280280

281-
@routes.route(create_point_json["route"],methods=create_point_json["methods"] )
281+
@routes.route(create_point_json["route"], methods=create_point_json["methods"])
282282
def create_point():
283283
utils_functions.validate_request(flask.request, create_point_json)
284284
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
@@ -291,7 +291,9 @@ def create_point():
291291
builder.create_point(opengeode.Point3D([x, y, z]))
292292

293293
generated_id = str(uuid.uuid4()).replace("-", "")
294-
saved_viewable_file_path = geode_functions.save_viewable("PointSet3D", PointSet3D, DATA_FOLDER_PATH, generated_id)
294+
saved_viewable_file_path = geode_functions.save_viewable(
295+
"PointSet3D", PointSet3D, DATA_FOLDER_PATH, generated_id
296+
)
295297

296298
return flask.make_response(
297299
{

tests/test_routes.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,13 @@ def get_full_data():
186186
error_description = response.json["description"]
187187
assert error_description == f"Validation error: '{key}' is a required property"
188188

189+
189190
def test_create_point(client):
190191
route = f"/create_point"
191192

192193
def get_full_data():
193-
return {
194-
"x": 1,
195-
"y": 2,
196-
"z": 3
197-
}
194+
return {"x": 1, "y": 2, "z": 3}
195+
198196
# Normal test with all keys
199197
response = client.post(route, json=get_full_data())
200198
assert response.status_code == 200
@@ -203,14 +201,10 @@ def get_full_data():
203201
id = response.json["id"]
204202
assert type(id) is str
205203

206-
207204
for key, value in get_full_data().items():
208205
json = get_full_data()
209206
json.pop(key)
210207
response = client.post(route, json=json)
211208
assert response.status_code == 400
212209
error_description = response.json["description"]
213210
assert error_description == f"Validation error: '{key}' is a required property"
214-
215-
216-

0 commit comments

Comments
 (0)