@geode/opengeodeweb-back 0.0.0-semantically-released
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +2 -0
- package/.github/workflows/Branch-protection.yml +11 -0
- package/.github/workflows/CD.yml +53 -0
- package/.github/workflows/prepare_pr.yml +11 -0
- package/.pylintrc +536 -0
- package/.pypirc +6 -0
- package/CHANGELOG.md +1223 -0
- package/COPYLEFT +4 -0
- package/LICENSE +21 -0
- package/README.md +32 -0
- package/app.py +54 -0
- package/config.py +29 -0
- package/generate_schemas.js +82 -0
- package/package.json +31 -0
- package/pyproject.toml +48 -0
- package/requirements.in +15 -0
- package/requirements.txt +116 -0
- package/src/OpenGeodeWeb_Back.egg-info/PKG-INFO +74 -0
- package/src/OpenGeodeWeb_Back.egg-info/SOURCES.txt +22 -0
- package/src/OpenGeodeWeb_Back.egg-info/dependency_links.txt +1 -0
- package/src/OpenGeodeWeb_Back.egg-info/requires.txt +28 -0
- package/src/OpenGeodeWeb_Back.egg-info/top_level.txt +1 -0
- package/src/opengeodeweb_back/__init__.py +0 -0
- package/src/opengeodeweb_back/geode_functions.py +330 -0
- package/src/opengeodeweb_back/geode_objects.py +429 -0
- package/src/opengeodeweb_back/inspector_functions.py +483 -0
- package/src/opengeodeweb_back/routes/blueprint_routes.py +178 -0
- package/src/opengeodeweb_back/routes/schemas/allowed_files.json +20 -0
- package/src/opengeodeweb_back/routes/schemas/allowed_objects.json +16 -0
- package/src/opengeodeweb_back/routes/schemas/geode_objects_and_output_extensions.json +21 -0
- package/src/opengeodeweb_back/routes/schemas/geographic_coordinate_systems.json +17 -0
- package/src/opengeodeweb_back/routes/schemas/missing_files.json +16 -0
- package/src/opengeodeweb_back/routes/schemas/upload_file.json +15 -0
- package/tests/__init__.py +0 -0
- package/tests/conftest.py +12 -0
- package/tests/corbi.og_brep +0 -0
- package/tests/data/test.bmp +0 -0
- package/tests/data/test.dat +11 -0
- package/tests/data/test.dev +121 -0
- package/tests/data/test.dxf +4184 -0
- package/tests/data/test.grdecl +2555 -0
- package/tests/data/test.jpg +0 -0
- package/tests/data/test.lso +3637 -0
- package/tests/data/test.ml +78770 -0
- package/tests/data/test.msh +800 -0
- package/tests/data/test.obj +24 -0
- package/tests/data/test.og_brep +0 -0
- package/tests/data/test.og_edc2d +0 -0
- package/tests/data/test.og_edc3d +0 -0
- package/tests/data/test.og_grp +0 -0
- package/tests/data/test.og_hso3d +0 -0
- package/tests/data/test.og_img2d +3 -0
- package/tests/data/test.og_img3d +0 -0
- package/tests/data/test.og_lrgd2d +0 -0
- package/tests/data/test.og_lrgd3d +0 -0
- package/tests/data/test.og_psf2d +0 -0
- package/tests/data/test.og_psf3d +0 -0
- package/tests/data/test.og_pso3d +0 -0
- package/tests/data/test.og_pts2d +0 -0
- package/tests/data/test.og_pts3d +0 -0
- package/tests/data/test.og_rgd2d +0 -0
- package/tests/data/test.og_rgd3d +0 -0
- package/tests/data/test.og_sctn +0 -0
- package/tests/data/test.og_strm +0 -0
- package/tests/data/test.og_tsf2d +0 -0
- package/tests/data/test.og_tsf3d +0 -0
- package/tests/data/test.og_tso3d +0 -0
- package/tests/data/test.og_vts +0 -0
- package/tests/data/test.og_xsctn +0 -0
- package/tests/data/test.ply +20 -0
- package/tests/data/test.png +0 -0
- package/tests/data/test.shp +0 -0
- package/tests/data/test.shx +0 -0
- package/tests/data/test.shz +0 -0
- package/tests/data/test.smesh +2049 -0
- package/tests/data/test.stl +7191 -0
- package/tests/data/test.svg +144 -0
- package/tests/data/test.ts +266 -0
- package/tests/data/test.txt +11 -0
- package/tests/data/test.vo +49 -0
- package/tests/data/test.vti +3 -0
- package/tests/data/test.vtp +212 -0
- package/tests/data/test.vtu +3585 -0
- package/tests/data/test.wl +76 -0
- package/tests/data/test__ascii@@ +1003 -0
- package/tests/test_functions.py +291 -0
- package/tests/test_routes.py +131 -0
- package/tmp.3491.json +0 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import uuid
|
|
3
|
+
from src.opengeodeweb_back import geode_functions, geode_objects
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_geode_object_value():
|
|
7
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
8
|
+
geode_object_value = geode_functions.geode_object_value(geode_object)
|
|
9
|
+
assert type(geode_object_value) is dict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_input_factory():
|
|
13
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
14
|
+
geode_object_input = geode_functions.input_factory(geode_object)
|
|
15
|
+
assert type(geode_object_input.list_creators()) is list
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_input_extensions():
|
|
19
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
20
|
+
geode_object_input_extensions = geode_functions.geode_object_input_extensions(
|
|
21
|
+
geode_object
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
assert type(geode_object_input_extensions) is list
|
|
25
|
+
for extension in geode_object_input_extensions:
|
|
26
|
+
assert type(extension) is str
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_output_factory():
|
|
30
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
31
|
+
geode_object_output = geode_functions.output_factory(geode_object)
|
|
32
|
+
geode_object_output_list = geode_object_output.list_creators()
|
|
33
|
+
assert type(geode_object_output_list) is list
|
|
34
|
+
for output in geode_object_output_list:
|
|
35
|
+
assert type(output) is str
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_missing_files():
|
|
39
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
40
|
+
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
|
|
41
|
+
for input_extension in input_extensions:
|
|
42
|
+
file_absolute_path = os.path.abspath(f"tests/data/test.{input_extension}")
|
|
43
|
+
missing_files = geode_functions.missing_files(
|
|
44
|
+
geode_object, file_absolute_path
|
|
45
|
+
)
|
|
46
|
+
has_missing_files = missing_files.has_missing_files()
|
|
47
|
+
assert type(has_missing_files) is bool
|
|
48
|
+
mandatory_files = missing_files.mandatory_files
|
|
49
|
+
assert type(mandatory_files) is list
|
|
50
|
+
additional_files = missing_files.additional_files
|
|
51
|
+
assert type(additional_files) is list
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def test_is_loadable():
|
|
55
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
56
|
+
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
|
|
57
|
+
for input_extension in input_extensions:
|
|
58
|
+
file_absolute_path = os.path.abspath(f"tests/data/test.{input_extension}")
|
|
59
|
+
is_loadable = geode_functions.is_loadable(geode_object, file_absolute_path)
|
|
60
|
+
assert type(is_loadable) is bool
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_load():
|
|
64
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
65
|
+
print(f"\n{geode_object=}")
|
|
66
|
+
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
|
|
67
|
+
for input_extension in input_extensions:
|
|
68
|
+
print(f"\t{input_extension=}")
|
|
69
|
+
missing_files = geode_functions.missing_files(
|
|
70
|
+
geode_object, f"tests/data/test.{input_extension}"
|
|
71
|
+
)
|
|
72
|
+
has_missing_files = missing_files.has_missing_files()
|
|
73
|
+
if has_missing_files:
|
|
74
|
+
mandatory_files = missing_files.mandatory_files
|
|
75
|
+
print(f"\t\t{mandatory_files=}")
|
|
76
|
+
additional_files = missing_files.additional_files
|
|
77
|
+
print(f"\t\t{additional_files=}")
|
|
78
|
+
file_apsolute_path = os.path.abspath(f"tests/data/test.{input_extension}")
|
|
79
|
+
if geode_functions.is_loadable(geode_object, file_apsolute_path):
|
|
80
|
+
data = geode_functions.load(geode_object, file_apsolute_path)
|
|
81
|
+
if "save_viewable" in value:
|
|
82
|
+
uu_id = str(uuid.uuid4()).replace("-", "")
|
|
83
|
+
viewable_file_path = geode_functions.save_viewable(
|
|
84
|
+
geode_object,
|
|
85
|
+
data,
|
|
86
|
+
os.path.abspath(f"./output"),
|
|
87
|
+
uu_id,
|
|
88
|
+
)
|
|
89
|
+
os.remove(viewable_file_path)
|
|
90
|
+
geode_objects_and_output_extensions = (
|
|
91
|
+
geode_functions.geode_objects_output_extensions(geode_object, data)
|
|
92
|
+
)
|
|
93
|
+
assert type(geode_objects_and_output_extensions) is dict
|
|
94
|
+
for (
|
|
95
|
+
output_geode_object,
|
|
96
|
+
output_geode_object_value,
|
|
97
|
+
) in geode_objects_and_output_extensions.items():
|
|
98
|
+
print(f"\t\t{output_geode_object=}")
|
|
99
|
+
for (
|
|
100
|
+
output_extension,
|
|
101
|
+
output_extension_value,
|
|
102
|
+
) in output_geode_object_value.items():
|
|
103
|
+
print(f"\t\t\t{output_extension=}")
|
|
104
|
+
uu_id = str(uuid.uuid4()).replace("-", "")
|
|
105
|
+
filename = f"{uu_id}.{output_extension}"
|
|
106
|
+
if geode_functions.is_saveable(
|
|
107
|
+
output_geode_object, data, filename
|
|
108
|
+
):
|
|
109
|
+
saved_files = geode_functions.save(
|
|
110
|
+
output_geode_object,
|
|
111
|
+
data,
|
|
112
|
+
os.path.abspath(f"./output"),
|
|
113
|
+
filename,
|
|
114
|
+
)
|
|
115
|
+
assert type(saved_files) is list
|
|
116
|
+
for saved_file in saved_files:
|
|
117
|
+
os.remove(saved_file)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def test_is_model():
|
|
121
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
122
|
+
is_model = geode_functions.is_model(geode_object)
|
|
123
|
+
assert type(is_model) is bool
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def test_is_3D():
|
|
127
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
128
|
+
is_3D = geode_functions.is_3D(geode_object)
|
|
129
|
+
assert type(is_3D) is bool
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def test_is_viewable():
|
|
133
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
134
|
+
is_viewable = geode_functions.is_viewable(geode_object)
|
|
135
|
+
assert type(is_viewable) is bool
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def test_geode_object_input_extensions():
|
|
139
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
140
|
+
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
|
|
141
|
+
assert type(input_extensions) is list
|
|
142
|
+
for input_extension in input_extensions:
|
|
143
|
+
assert type(input_extension) is str
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def test_geode_object_output_extensions():
|
|
147
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
148
|
+
print(f"\n{geode_object=}")
|
|
149
|
+
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
|
|
150
|
+
for input_extension in input_extensions:
|
|
151
|
+
print(f"\t{input_extension=}")
|
|
152
|
+
missing_files = geode_functions.missing_files(
|
|
153
|
+
geode_object, f"tests/data/test.{input_extension}"
|
|
154
|
+
)
|
|
155
|
+
has_missing_files = missing_files.has_missing_files()
|
|
156
|
+
if has_missing_files:
|
|
157
|
+
mandatory_files = missing_files.mandatory_files
|
|
158
|
+
print(f"\t\t{mandatory_files=}")
|
|
159
|
+
additional_files = missing_files.additional_files
|
|
160
|
+
print(f"\t\t{additional_files=}")
|
|
161
|
+
file_absolute_path = os.path.abspath(f"tests/data/test.{input_extension}")
|
|
162
|
+
if geode_functions.is_loadable(geode_object, file_absolute_path):
|
|
163
|
+
data = geode_functions.load(geode_object, file_absolute_path)
|
|
164
|
+
geode_objets_and_output_extensions = (
|
|
165
|
+
geode_functions.geode_objects_output_extensions(geode_object, data)
|
|
166
|
+
)
|
|
167
|
+
assert type(geode_objets_and_output_extensions) is dict
|
|
168
|
+
for (
|
|
169
|
+
output_geode_object,
|
|
170
|
+
output_geode_object_value,
|
|
171
|
+
) in geode_objets_and_output_extensions.items():
|
|
172
|
+
for (
|
|
173
|
+
output_extension,
|
|
174
|
+
output_extension_value,
|
|
175
|
+
) in output_geode_object_value.items():
|
|
176
|
+
assert type(output_extension) is str
|
|
177
|
+
assert type(output_extension_value["is_saveable"]) is bool
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def test_filter_geode_objects():
|
|
181
|
+
filters_list = ["", "crs", "inspector", None]
|
|
182
|
+
|
|
183
|
+
for filter in filters_list:
|
|
184
|
+
geode_objects_filtered_list = geode_functions.filter_geode_objects(filter)
|
|
185
|
+
assert type(geode_objects_filtered_list) is list
|
|
186
|
+
for geode_object in geode_objects_filtered_list:
|
|
187
|
+
assert type(geode_object) is str
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def test_list_input_extensions():
|
|
191
|
+
keys_array = ["crs", "inspector", None]
|
|
192
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
193
|
+
for keys in keys_array:
|
|
194
|
+
input_extensions = geode_functions.list_input_extensions(keys)
|
|
195
|
+
assert type(input_extensions) is list
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
def test_list_geode_objects():
|
|
199
|
+
test_list = [
|
|
200
|
+
{
|
|
201
|
+
"key": "crs",
|
|
202
|
+
"invalid_geode_objects": [
|
|
203
|
+
"Graph",
|
|
204
|
+
"RasterImage2D",
|
|
205
|
+
"RasterImage3D",
|
|
206
|
+
"VertexSet",
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"key": "inspector",
|
|
211
|
+
"invalid_geode_objects": [
|
|
212
|
+
"Graph",
|
|
213
|
+
"RasterImage2D",
|
|
214
|
+
"RasterImage3D",
|
|
215
|
+
"VertexSet",
|
|
216
|
+
],
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"key": None,
|
|
220
|
+
"invalid_geode_objects": [],
|
|
221
|
+
},
|
|
222
|
+
]
|
|
223
|
+
for test in test_list:
|
|
224
|
+
key = test["key"]
|
|
225
|
+
invalid_geode_objects = test["invalid_geode_objects"]
|
|
226
|
+
|
|
227
|
+
input_extensions = geode_functions.list_input_extensions(key)
|
|
228
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
229
|
+
for input_extension in input_extensions:
|
|
230
|
+
file_absolute_path = os.path.abspath(
|
|
231
|
+
f"tests/data/test.{input_extension}"
|
|
232
|
+
)
|
|
233
|
+
return_dict = geode_functions.list_geode_objects(
|
|
234
|
+
file_absolute_path, key
|
|
235
|
+
)
|
|
236
|
+
assert type(return_dict) is dict
|
|
237
|
+
|
|
238
|
+
if key != None:
|
|
239
|
+
assert len(return_dict.keys()) > 0
|
|
240
|
+
for invalid_geode_object in invalid_geode_objects:
|
|
241
|
+
assert invalid_geode_object not in return_dict.keys()
|
|
242
|
+
else:
|
|
243
|
+
assert len(return_dict.keys()) >= 1
|
|
244
|
+
for input_geode_object, input_extension_dict in return_dict.items():
|
|
245
|
+
assert type(input_extension_dict) is dict
|
|
246
|
+
for (
|
|
247
|
+
input_extension,
|
|
248
|
+
input_extension_value,
|
|
249
|
+
) in input_extension_dict.items():
|
|
250
|
+
assert type(input_extension_value) is bool
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
def test_geode_objects_output_extensions():
|
|
254
|
+
for geode_object, value in geode_objects.geode_objects_dict().items():
|
|
255
|
+
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
|
|
256
|
+
for input_extension in input_extensions:
|
|
257
|
+
file_absolute_path = f"tests/data/test.{input_extension}"
|
|
258
|
+
if geode_functions.is_loadable(geode_object, file_absolute_path):
|
|
259
|
+
data = geode_functions.load(geode_object, file_absolute_path)
|
|
260
|
+
geode_objects_and_output_extensions = (
|
|
261
|
+
geode_functions.geode_objects_output_extensions(geode_object, data)
|
|
262
|
+
)
|
|
263
|
+
assert type(geode_objects_and_output_extensions) is dict
|
|
264
|
+
for (
|
|
265
|
+
output_geode_object,
|
|
266
|
+
output_geode_object_value,
|
|
267
|
+
) in geode_objects_and_output_extensions.items():
|
|
268
|
+
for (
|
|
269
|
+
output_extension,
|
|
270
|
+
output_extension_value,
|
|
271
|
+
) in output_geode_object_value.items():
|
|
272
|
+
assert type(output_extension_value["is_saveable"]) is bool
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
def test_versions():
|
|
276
|
+
list_packages = [
|
|
277
|
+
"OpenGeode-core",
|
|
278
|
+
"OpenGeode-IO",
|
|
279
|
+
"OpenGeode-Geosciences",
|
|
280
|
+
"OpenGeode-GeosciencesIO",
|
|
281
|
+
]
|
|
282
|
+
versions = geode_functions.versions(list_packages)
|
|
283
|
+
assert type(versions) is list
|
|
284
|
+
for version in versions:
|
|
285
|
+
assert type(version) is dict
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def test_extension_from_filename():
|
|
289
|
+
extension = geode_functions.extension_from_filename("test.toto")
|
|
290
|
+
assert type(extension) is str
|
|
291
|
+
assert extension.count(".") == 0
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import base64
|
|
3
|
+
from werkzeug.datastructures import FileStorage
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_allowed_files(client):
|
|
7
|
+
route = f"/allowed_files"
|
|
8
|
+
response = client.post(route, json={"key": None})
|
|
9
|
+
assert response.status_code == 200
|
|
10
|
+
extensions = response.json["extensions"]
|
|
11
|
+
assert type(extensions) is list
|
|
12
|
+
for extension in extensions:
|
|
13
|
+
assert type(extension) is str
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def test_allowed_objects(client):
|
|
17
|
+
route = f"/allowed_objects"
|
|
18
|
+
|
|
19
|
+
def get_full_data():
|
|
20
|
+
return {
|
|
21
|
+
"filename": "corbi.og_brep",
|
|
22
|
+
"key": None,
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Normal test with filename 'corbi.og_brep'
|
|
26
|
+
response = client.post(route, json=get_full_data())
|
|
27
|
+
assert response.status_code == 200
|
|
28
|
+
allowed_objects = response.json["allowed_objects"]
|
|
29
|
+
assert type(allowed_objects) is dict
|
|
30
|
+
for allowed_object in allowed_objects:
|
|
31
|
+
assert type(allowed_object) is str
|
|
32
|
+
|
|
33
|
+
for key, value in get_full_data().items():
|
|
34
|
+
json = get_full_data()
|
|
35
|
+
json.pop(key)
|
|
36
|
+
response = client.post(route, json=json)
|
|
37
|
+
assert response.status_code == 400
|
|
38
|
+
error_description = response.json["description"]
|
|
39
|
+
assert error_description == f"Validation error: '{key}' is a required property"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def test_upload_file(client):
|
|
43
|
+
response = client.put(
|
|
44
|
+
f"/upload_file",
|
|
45
|
+
data={"file": FileStorage(open("./tests/corbi.og_brep", "rb"))},
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
assert response.status_code == 201
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def test_missing_files(client):
|
|
52
|
+
route = f"/missing_files"
|
|
53
|
+
|
|
54
|
+
def get_full_data():
|
|
55
|
+
return {
|
|
56
|
+
"input_geode_object": "BRep",
|
|
57
|
+
"filename": "corbi.og_brep",
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
json = get_full_data()
|
|
61
|
+
response = client.post(
|
|
62
|
+
route,
|
|
63
|
+
json=json,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
assert response.status_code == 200
|
|
67
|
+
has_missing_files = response.json["has_missing_files"]
|
|
68
|
+
mandatory_files = response.json["mandatory_files"]
|
|
69
|
+
additional_files = response.json["additional_files"]
|
|
70
|
+
assert type(has_missing_files) is bool
|
|
71
|
+
assert type(mandatory_files) is list
|
|
72
|
+
assert type(additional_files) is list
|
|
73
|
+
|
|
74
|
+
for key, value in get_full_data().items():
|
|
75
|
+
json = get_full_data()
|
|
76
|
+
json.pop(key)
|
|
77
|
+
response = client.post(route, json=json)
|
|
78
|
+
assert response.status_code == 400
|
|
79
|
+
error_description = response.json["description"]
|
|
80
|
+
assert error_description == f"Validation error: '{key}' is a required property"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def test_geographic_coordinate_systems(client):
|
|
84
|
+
route = f"/geographic_coordinate_systems"
|
|
85
|
+
|
|
86
|
+
# Normal test with geode_object 'BRep'
|
|
87
|
+
response = client.post(route, json={"input_geode_object": "BRep"})
|
|
88
|
+
assert response.status_code == 200
|
|
89
|
+
crs_list = response.json["crs_list"]
|
|
90
|
+
assert type(crs_list) is list
|
|
91
|
+
for crs in crs_list:
|
|
92
|
+
assert type(crs) is dict
|
|
93
|
+
|
|
94
|
+
# Test without geode_object
|
|
95
|
+
response = client.post(route, json={})
|
|
96
|
+
assert response.status_code == 400
|
|
97
|
+
error_message = response.json["description"]
|
|
98
|
+
assert (
|
|
99
|
+
error_message == "Validation error: 'input_geode_object' is a required property"
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def test_geode_objects_and_output_extensions(client):
|
|
104
|
+
route = "/geode_objects_and_output_extensions"
|
|
105
|
+
|
|
106
|
+
def get_full_data():
|
|
107
|
+
return {
|
|
108
|
+
"input_geode_object": "BRep",
|
|
109
|
+
"filename": "corbi.og_brep",
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
response = client.post(route, json=get_full_data())
|
|
113
|
+
|
|
114
|
+
assert response.status_code == 200
|
|
115
|
+
geode_objects_and_output_extensions = response.json[
|
|
116
|
+
"geode_objects_and_output_extensions"
|
|
117
|
+
]
|
|
118
|
+
assert type(geode_objects_and_output_extensions) is dict
|
|
119
|
+
for geode_object, values in geode_objects_and_output_extensions.items():
|
|
120
|
+
assert type(values) is dict
|
|
121
|
+
for output_extension, value in values.items():
|
|
122
|
+
assert type(value) is dict
|
|
123
|
+
assert type(value["is_saveable"]) is bool
|
|
124
|
+
|
|
125
|
+
# Test without input_geode_object
|
|
126
|
+
response = client.post(route, json={})
|
|
127
|
+
assert response.status_code == 400
|
|
128
|
+
error_message = response.json["description"]
|
|
129
|
+
assert (
|
|
130
|
+
error_message == "Validation error: 'input_geode_object' is a required property"
|
|
131
|
+
)
|
package/tmp.3491.json
ADDED
|
File without changes
|