Skip to content

Commit

Permalink
Next (#350)
Browse files Browse the repository at this point in the history
* add docker squash

* retrigger run

* add branch protection

* fix : move generated directory in upload folder (#129)

* PR to develop (#130)

* Feature/error handling (#124)

* feat(wip) : try except

* update requirements

* feat(wip) : refactor

* fix : update requirements

* fix

* merge develop into feature/errors_handling

* Feature/crs (#131)

* feat(wip) : try except

* update requirements

* feat(wip) : refactor

* fix : update requirements

* fix

* merge develop into feature/errors_handling

* crs blueprint

* geographic_coordinate_systems

* geographic_coordinate_systems return crs_list

* feat(wip) : crs_converter output_file_extensions
& add crs_converter tests

* update requirements

* passing unit tests

* explode input & output crs
load model

* update requirements

* add send_from_directory

* add is_model
update requirements

* fix tests and refactor

* add builders

* add crs key to geode_objects assign/convert

* code cleanup

* refactor + remove console.logs

* Update requirements.txt

Co-authored-by: Arnaud Botella <[email protected]>

* update crs tests

* 14.1.11-rc1

* re arange functions place

* start update tests

* add crs_converter mesh tests

* add crs=False

* update requirements

---------

Co-authored-by: Arnaud Botella <[email protected]>

* Fix/secure unit tests (#157)

* Develop (#132)

* add docker squash

* retrigger run

* add branch protection

* fix : move generated directory in upload folder (#129)

* PR to develop (#130)

* Feature/error handling (#124)

* feat(wip) : try except

* update requirements

* feat(wip) : refactor

* fix : update requirements

* fix

* merge develop into feature/errors_handling

* Feature/crs (#131)

* feat(wip) : try except

* update requirements

* feat(wip) : refactor

* fix : update requirements

* fix

* merge develop into feature/errors_handling

* crs blueprint

* geographic_coordinate_systems

* geographic_coordinate_systems return crs_list

* feat(wip) : crs_converter output_file_extensions
& add crs_converter tests

* update requirements

* passing unit tests

* explode input & output crs
load model

* update requirements

* add send_from_directory

* add is_model
update requirements

* fix tests and refactor

* add builders

* add crs key to geode_objects assign/convert

* code cleanup

* refactor + remove console.logs

* Update requirements.txt

Co-authored-by: Arnaud Botella <[email protected]>

* update crs tests

* 14.1.11-rc1

* re arange functions place

* start update tests

* add crs_converter mesh tests

* add crs=False

* update requirements

---------

Co-authored-by: Arnaud Botella <[email protected]>

---------

Co-authored-by: Arnaud Botella <[email protected]>

* add test data files

* launch tests

* (wip) : update tests

* update unit tests

* pep8 formatting

* Update requirements.txt

* update unit tests

* add get_form_variables function

* tests passing

---------

Co-authored-by: Arnaud Botella <[email protected]>

* Feature refactoring (#162)

* save

* update passing tests

* import geode_functions in app.py

* opengeodeweb-back==0.0.14

* empty commit

* upload before test

* add filename

* function upload_files()

* remove tests

* Add LICENSE_TOKEN

* test

* test wget license file

* test

* test

* remove LICENSE_TOKEN

* Feature workflows (#164)

* Develop (#132)

* add docker squash

* retrigger run

* add branch protection

* fix : move generated directory in upload folder (#129)

* PR to develop (#130)

* Feature/error handling (#124)

* feat(wip) : try except

* update requirements

* feat(wip) : refactor

* fix : update requirements

* fix

* merge develop into feature/errors_handling

* Feature/crs (#131)

* feat(wip) : try except

* update requirements

* feat(wip) : refactor

* fix : update requirements

* fix

* merge develop into feature/errors_handling

* crs blueprint

* geographic_coordinate_systems

* geographic_coordinate_systems return crs_list

* feat(wip) : crs_converter output_file_extensions
& add crs_converter tests

* update requirements

* passing unit tests

* explode input & output crs
load model

* update requirements

* add send_from_directory

* add is_model
update requirements

* fix tests and refactor

* add builders

* add crs key to geode_objects assign/convert

* code cleanup

* refactor + remove console.logs

* Update requirements.txt

Co-authored-by: Arnaud Botella <[email protected]>

* update crs tests

* 14.1.11-rc1

* re arange functions place

* start update tests

* add crs_converter mesh tests

* add crs=False

* update requirements

---------

Co-authored-by: Arnaud Botella <[email protected]>

---------

Co-authored-by: Arnaud Botella <[email protected]>

* Adding workflows blueprint

* Updating requirements

* Change BBox points input

* test

* update CD workflow

* Changing env

* Adding data files

* Allowing .env file

* Fix / undefined bbox points

* Added grid cell size

* Added venv and packages

* added Web-Back lib and get_form_variables function

* added Web-Back lib and get_form_variables function

* Replaced all replaceable functions

* Fixed form variables format

* Fix : split variables

* Added : workflows tests template

* Fix : path name

* Fix : route methods

* Add : workflow ong tests + exemple set from file

* Added tests + exception handling + absolute paths

* Fixed exceptions + Added tests with stupid values

* Fix : Dockerfile python version

* Add : args to docker build + lic download

* Test : secret name

* test secret name

* test concat

* test force

* test

* Test : build with if/else

* Fix : opengeodeweb version

* deleted tests

* Test : get license with curl

* Fix : opengeodeweb version

* Test : curl

* Test : curl bis

* Test : corrected version

* Test with bearer

* Test : curl ter

* test : curl with ref

* Test : curl without ref

* test : curl again

* Test : right file name

* remove test

* clean actions

* Add : lock and time files requests

* Fix : abspath in lock and time requests

* Add : blueprints tree structure

* Fix : blueprints importations

* Fix : blueprints names

* Fix : new routes in tests

* Fix : added abspath to lock and time folders

* Add : child bp imported in parents bp

* Fix : importation routes

* Fix : bp names

* Removed lock and time folder from child bp

* fix : loading data

* fix : saving data

* Fix : save args

* Changed workflows routes names

* Updated routes in tests

* Delete venv directory

* Delete .env

* edit ignore

* fixed inspector

* removed before and teardown requests

* Rename workflows + clean code + data folders

* Added "/" before file names

* Fixed "/" in file routes

* Fixed data folder for tests

---------

Co-authored-by: Julien Champagnol <[email protected]>
Co-authored-by: Arnaud Botella <[email protected]>

* Update port 5000

* test config

* remove ID from url_prefix

* remove ID in tests

* Feature add viewers (#165)

* better implicit workflow (#171)

* better implicit workflow

* fix tests

* add log

* remove implicit surfaces

* update implicit points

* update requirements

* update simplex

* fix tests

* update explicit

* fix tests

* update explicit

* add sharp section

* update data

* fix tests

* fix tests

* update to next branch convention

* image_name: 'website-back'

* /website/createbackend

* update requirements

* fix tests

* update folders paths

* Feat validation (#196)

* update

* update

* new version of website back

* update blueprint_validity_checker.py

* update unit tests and requirements

* update unit tests

* update .env

* fix unit tests

* change upload_file

* clean code

* update .env

* update content

* test

* remove filename

* add FileStorage

* file basename

* os.mkdir(UPLOAD_FOLDER)

---------

Co-authored-by: JulienChampagnol <[email protected]>

* Feat validation (#203)

* update

* update

* new version of website back

* update blueprint_validity_checker.py

* update unit tests and requirements

* update unit tests

* update .env

* fix unit tests

* change upload_file

* clean code

* update .env

* update content

* test

* remove filename

* add FileStorage

* file basename

* os.mkdir(UPLOAD_FOLDER)

---------

Co-authored-by: SpliiT <[email protected]>

* add prepare pr

* Json Back - Upgrade (#206)

* Json Back - Upgrade

* Apply prepare changes

* remove geode_objects.py

* Remove useless specifications

* Update opengeodeweb-back==2.0.0

* add upload file funciton

* feat(tools): add missing files and class heritage (#205)

Co-authored-by: Arnaud Botella <[email protected]>
Co-authored-by: Julien Champagnol <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>
Co-authored-by: SpliiT <[email protected]>
Co-authored-by: Clémentine <[email protected]>
Co-authored-by: Tao Schiro <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>
fix : move generated directory in upload folder (#129)
Fix/secure unit tests (#157)

* fix explicit_remesh_json

* Feat refactor schemas (#209)

* Next (#208)

Co-authored-by: Arnaud Botella <[email protected]>
Co-authored-by: Julien Champagnol <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>
Co-authored-by: SpliiT <[email protected]>
Co-authored-by: Clémentine <[email protected]>
Co-authored-by: Tao Schiro <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>

* Refactoring crs_converter

* rename json file

* python files edited : refactoring routes

---------

Co-authored-by: Julien Champagnol <[email protected]>
Co-authored-by: Arnaud Botella <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>
Co-authored-by: Clémentine <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>

* Feat is saveable (#213)

* Next (#208)

Co-authored-by: Arnaud Botella <[email protected]>
Co-authored-by: Julien Champagnol <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>
Co-authored-by: SpliiT <[email protected]>
Co-authored-by: Clémentine <[email protected]>
Co-authored-by: Tao Schiro <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>

* feat(schemas): filename becomes array

* update deps

* deactivate workflows

* feat(tools_routes): refactor routes

BREAKING CHANGE: routes now can handle multiple files, filename becomes filenames

* save

* update requirements

* move geographic_coordinate_systems to tools

* update tests from api change

* move geographic_coordinate_systems to tools

* activate implicit

* remove print

* revert schemas

* tools blueprint mono file

* mono file output_extensions

* remove prints

* update tests and requirements

---------

Co-authored-by: Arnaud Botella <[email protected]>
Co-authored-by: SpliiT <[email protected]>
Co-authored-by: Clémentine <[email protected]>
Co-authored-by: Tao Schiro <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>

* update requirements

* update ogw-back dependencies

* update to opengeodeweb-back 3.0.0

* update ogw-back (#222)

* update ogw-back and tests

* test print

* test OPTIONS

* flush=True

* remove prints

* opengeodeweb-back 3.1.0

* Feat_bp_tools (#217)

* upgrade blueprint tools and dependencies

* fix some merge conflicts

* update requirements

* remove unused packages

* opengeodeweb-back==3.2.0rc10

* cleanup

---------

Co-authored-by: JulienChampagnol <[email protected]>

* opengeodeweb-back 3.2.0

* Chore/ogw back (#243)

* update requirements

* chore(dependencies): update ecosystem

* Apply prepare changes

---------

Co-authored-by: JulienChampagnol <[email protected]>

* Chore/ogw back (#244)

* delete unused schemas

* delete unused schemas 2

* Chore/ogw back (#247)

* delete unused schemas

* delete unused schemas 2

* chore(dependencies): update ecosystem

* chore(dependencies): update ecosystem

* Chore/ogw back (#284)

* delete unused schemas

* delete unused schemas 2

* chore(dependencies): update ecosystem

* chore(dependencies): update ecosystem

* fix(ogw_back): fix opengeodeweb_back blueprint

* Feat/refactor inspector (#309)

* update opengeode dependencies

* feat(inspector): remove unused routes and schemas

* remove unused imports

* Apply prepare changes

---------

Co-authored-by: JulienChampagnol <[email protected]>

* Error handler (#324)

* errorhandler

* ogwb 4.2

* chore(deps): update ogw_back (#329)

* Chore/update ogw back (#348)

* fix changes

* api changes

* fix imports

* Apply prepare changes

* opengeodeweb-back 5.1.0
before_request & teardown_request

---------

Co-authored-by: JulienChampagnol <[email protected]>

* Chore/ogw back changes (#349)

* remove kill_task

* remove LOCK_FOLDER & TIME_FOLDER

* remove ping route

* update tests

* Apply prepare changes

---------

Co-authored-by: JulienChampagnol <[email protected]>

---------

Co-authored-by: Arnaud Botella <[email protected]>
Co-authored-by: Clémentine <[email protected]>
Co-authored-by: Tao Schiro <[email protected]>
Co-authored-by: SpliiT <[email protected]>
Co-authored-by: JulienChampagnol <[email protected]>
  • Loading branch information
6 people authored Sep 18, 2024
1 parent 010ab37 commit 4ef18af
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 359 deletions.
49 changes: 4 additions & 45 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import blueprints.blueprint_workflows as bp_workflows
import blueprints.blueprint_ID as bp_ID

from opengeodeweb_back import geode_functions
from opengeodeweb_back.routes import blueprint_routes
from opengeodeweb_back.utils_functions import handle_exception, kill_task, set_interval

from werkzeug.exceptions import HTTPException

Expand All @@ -27,35 +27,6 @@
app = flask.Flask(__name__)


def kill_task():
if not os.path.exists(LOCK_FOLDER):
os.mkdir(LOCK_FOLDER)
if not os.path.exists(TIME_FOLDER):
os.mkdir(TIME_FOLDER)

if len(os.listdir(LOCK_FOLDER)) == 0:
print(f"No files in the {LOCK_FOLDER} folder, shutting down...", flush=True)
os._exit(0)
if not os.path.isfile(TIME_FOLDER + "/time.txt"):
print("'time.txt' file doesn't exist, shutting down...", flush=True)
os._exit(0)
if os.path.isfile(TIME_FOLDER + "/time.txt"):
with open(TIME_FOLDER + "/time.txt", "r") as file:
try:
last_request_time = float(file.read())
except Exception as e:
print("error : ", str(e), flush=True)
os._exit(0)
current_time = time.time()
if (current_time - last_request_time) / 60 > MINUTES_BEFORE_TIMEOUT:
print(
"Server timed out due to inactivity, shutting down...", flush=True
)
os._exit(0)
if os.path.isfile(LOCK_FOLDER + "/ping.txt"):
os.remove(LOCK_FOLDER + "/ping.txt")


""" Config variables """
FLASK_DEBUG = True if os.environ.get("FLASK_DEBUG", default=None) == "True" else False

Expand All @@ -68,8 +39,6 @@ def kill_task():
PORT = int(app.config.get("PORT"))
ORIGINS = app.config.get("ORIGINS")
SSL = app.config.get("SSL")
LOCK_FOLDER = app.config.get("LOCK_FOLDER")
TIME_FOLDER = app.config.get("TIME_FOLDER")
MINUTES_BEFORE_TIMEOUT = float(app.config.get("MINUTES_BEFORE_TIMEOUT"))
SECONDS_BETWEEN_SHUTDOWNS = float(app.config.get("SECONDS_BETWEEN_SHUTDOWNS"))

Expand All @@ -87,24 +56,14 @@ def kill_task():

app.register_blueprint(bp_ID.ID_routes, url_prefix="/", name="ID_blueprint")


if FLASK_DEBUG == False:
geode_functions.set_interval(kill_task, SECONDS_BETWEEN_SHUTDOWNS)
set_interval(kill_task, SECONDS_BETWEEN_SHUTDOWNS)
flask_cors.CORS(app, origins=ORIGINS)


@app.errorhandler(HTTPException)
def handle_exception(e):
response = e.get_response()
response.data = flask.json.dumps(
{
"code": e.code,
"name": e.name,
"description": e.description,
}
)
response.content_type = "application/json"
return response
def errorhandler(e):
return handle_exception(e)


@app.route("/createbackend", methods=["POST"])
Expand Down
9 changes: 0 additions & 9 deletions blueprints/ID_ping.json

This file was deleted.

13 changes: 0 additions & 13 deletions blueprints/blueprint_ID.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
with open("blueprints/ID_healthcheck.json") as file:
ID_healthcheck_json = json.load(file)

with open("blueprints/ID_ping.json") as file:
ID_ping_json = json.load(file)

ID_routes = flask.Blueprint("ID_routes", __name__)
flask_cors.CORS(ID_routes)
Expand All @@ -19,14 +17,3 @@
@ID_routes.route(ID_healthcheck_json["route"], methods=ID_healthcheck_json["methods"])
def root():
return flask.make_response({"message": "healthy"}, 200)


@ID_routes.route(ID_ping_json["route"], methods=ID_ping_json["methods"])
def ping():
LOCK_FOLDER = flask.current_app.config["LOCK_FOLDER"]
if not os.path.exists(LOCK_FOLDER):
os.mkdir(LOCK_FOLDER)
if not os.path.isfile(LOCK_FOLDER + "/ping.txt"):
f = open(LOCK_FOLDER + "/ping.txt", "a")
f.close()
return flask.make_response({"message": "Flask server is running"}, 200)
13 changes: 3 additions & 10 deletions blueprints/blueprint_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Third party imports
import flask
import flask_cors
from opengeodeweb_back import geode_functions, geode_objects
from opengeodeweb_back import utils_functions
import werkzeug

import blueprints.tools.blueprint_file_converter as bp_file_converter
Expand All @@ -19,19 +19,12 @@

@tools_routes.before_request
def before_request():
geode_functions.create_lock_file(
os.path.abspath(flask.current_app.config["LOCK_FOLDER"])
)
utils_functions.before_request(flask.current_app)


@tools_routes.teardown_request
def teardown_request(exception):
geode_functions.remove_lock_file(
os.path.abspath(flask.current_app.config["LOCK_FOLDER"])
)
geode_functions.create_time_file(
os.path.abspath(flask.current_app.config["TIME_FOLDER"])
)
utils_functions.teardown_request(flask.current_app)


tools_routes.register_blueprint(
Expand Down
13 changes: 3 additions & 10 deletions blueprints/blueprint_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Third party imports
import flask
import flask_cors
from opengeodeweb_back import geode_functions, geode_objects
from opengeodeweb_back import utils_functions

import blueprints.workflows.blueprint_implicit as bp_implicit
import blueprints.workflows.blueprint_simplex as bp_simplex
Expand All @@ -16,19 +16,12 @@

@workflows_routes.before_request
def before_request():
geode_functions.create_lock_file(
os.path.abspath(flask.current_app.config["LOCK_FOLDER"])
)
utils_functions.before_request(flask.current_app)


@workflows_routes.teardown_request
def teardown_request(exception):
geode_functions.remove_lock_file(
os.path.abspath(flask.current_app.config["LOCK_FOLDER"])
)
geode_functions.create_time_file(
os.path.abspath(flask.current_app.config["TIME_FOLDER"])
)
utils_functions.teardown_request(flask.current_app)


workflows_routes.register_blueprint(
Expand Down
10 changes: 5 additions & 5 deletions blueprints/tools/blueprint_crs_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import flask
import flask_cors
import werkzeug
from opengeodeweb_back import geode_functions
from opengeodeweb_back import geode_functions, utils_functions
import json

crs_converter_routes = flask.Blueprint("crs_converter_routes", __name__)
Expand All @@ -21,15 +21,15 @@
crs_converter_versions_json["route"], methods=crs_converter_versions_json["methods"]
)
def crs_converter_versions():
geode_functions.validate_request(flask.request, crs_converter_versions_json)
utils_functions.validate_request(flask.request, crs_converter_versions_json)
list_packages = [
"OpenGeode-core",
"OpenGeode-IO",
"OpenGeode-Geosciences",
"OpenGeode-GeosciencesIO",
]
return flask.make_response(
{"versions": geode_functions.versions(list_packages)}, 200
{"versions": utils_functions.versions(list_packages)}, 200
)


Expand All @@ -42,7 +42,7 @@ def crs_converter_versions():
methods=crs_converter_convert_file_json["methods"],
)
async def crs_converter_convert_file():
geode_functions.validate_request(
utils_functions.validate_request(
flask.request,
crs_converter_convert_file_json,
)
Expand All @@ -67,4 +67,4 @@ async def crs_converter_convert_file():
os.path.abspath(UPLOAD_FOLDER),
new_file_name,
)
return geode_functions.send_file(UPLOAD_FOLDER, saved_files, new_file_name)
return utils_functions.send_file(UPLOAD_FOLDER, saved_files, new_file_name)
10 changes: 5 additions & 5 deletions blueprints/tools/blueprint_file_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import flask
import flask_cors
import werkzeug
from opengeodeweb_back import geode_functions
from opengeodeweb_back import geode_functions, utils_functions
import json


Expand All @@ -23,7 +23,7 @@
methods=file_converter_versions_json["methods"],
)
def file_converter_versions():
geode_functions.validate_request(flask.request, file_converter_versions_json)
utils_functions.validate_request(flask.request, file_converter_versions_json)
list_packages = [
"OpenGeode-core",
"OpenGeode-IO",
Expand All @@ -32,7 +32,7 @@ def file_converter_versions():
]

return flask.make_response(
{"versions": geode_functions.versions(list_packages)}, 200
{"versions": utils_functions.versions(list_packages)}, 200
)


Expand All @@ -45,7 +45,7 @@ def file_converter_versions():
methods=file_converter_convert_file_json["methods"],
)
async def file_converter_convert_file():
geode_functions.validate_request(flask.request, file_converter_convert_file_json)
utils_functions.validate_request(flask.request, file_converter_convert_file_json)
UPLOAD_FOLDER = flask.current_app.config["UPLOAD_FOLDER"]

secure_filename = werkzeug.utils.secure_filename(flask.request.json["filename"])
Expand All @@ -60,4 +60,4 @@ async def file_converter_convert_file():
os.path.abspath(UPLOAD_FOLDER),
new_file_name,
)
return geode_functions.send_file(UPLOAD_FOLDER, saved_files, new_file_name)
return utils_functions.send_file(UPLOAD_FOLDER, saved_files, new_file_name)
78 changes: 4 additions & 74 deletions blueprints/tools/blueprint_validity_checker.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Standard library imports
import os
#

# Third party imports
import flask
import flask_cors
import werkzeug
from opengeodeweb_back import geode_functions, inspector_functions
from opengeodeweb_back import geode_functions, utils_functions
import json

validity_checker_routes = flask.Blueprint("validity_checker_routes", __name__)
Expand All @@ -21,7 +20,7 @@
methods=validity_checker_versions_json["methods"],
)
def validity_checker_versions():
geode_functions.validate_request(flask.request, validity_checker_versions_json)
utils_functions.validate_request(flask.request, validity_checker_versions_json)
list_packages = [
"OpenGeode-core",
"OpenGeode-IO",
Expand All @@ -30,74 +29,5 @@ def validity_checker_versions():
"OpenGeode-Inspector",
]
return flask.make_response(
{"versions": geode_functions.versions(list_packages)}, 200
)


with open("blueprints/tools/validity_checker_test_names.json", "r") as file:
validity_checker_test_names_json = json.load(file)


@validity_checker_routes.route(
validity_checker_test_names_json["route"],
methods=validity_checker_test_names_json["methods"],
)
def validity_checker_test_names():
geode_functions.validate_request(flask.request, validity_checker_test_names_json)
model_checks = inspector_functions.json_return(
inspector_functions.inspectors()[flask.request.json["input_geode_object"]][
"tests_names"
]
)

return flask.make_response({"model_checks": model_checks}, 200)


with open("blueprints/tools/validity_checker_inspect_file.json", "r") as file:
validity_checker_inspect_file_json = json.load(file)


@validity_checker_routes.route(
validity_checker_inspect_file_json["route"],
methods=validity_checker_inspect_file_json["methods"],
)
def validity_checker_inspect_file():
geode_functions.validate_request(flask.request, validity_checker_inspect_file_json)
UPLOAD_FOLDER = flask.current_app.config["UPLOAD_FOLDER"]

secure_filename = werkzeug.utils.secure_filename(flask.request.json["filename"])
file_path = os.path.abspath(os.path.join(UPLOAD_FOLDER, secure_filename))
data = geode_functions.load(flask.request.json["input_geode_object"], file_path)
inspector = geode_functions.inspector(
flask.request.json["input_geode_object"], data
)
test_result = getattr(inspector, flask.request.json["test"])()

if type(test_result) == int:
expected_result = 0
elif type(test_result) == list:
expected_result = []
elif type(test_result) == dict:
expected_result = {}

if test_result != expected_result or type(test_result) != type(expected_result):
if type(test_result) is list:
if type(test_result[0]) is tuple:
temp_test_result = []
for tuple_item in test_result:
temp_list = []
for index in range(len(tuple_item)):
temp_list.append(tuple_item[index].string())
temp_test_result.append(temp_list)
test_result = temp_test_result
result = test_result == expected_result and type(test_result) == type(
expected_result
)

if result is False:
test_name = flask.request.json["test"]
print(f"Wrong test result: {test_name}", flush=True)

return flask.make_response(
{"result": result, "list_invalidities": str(test_result)}, 200
{"versions": utils_functions.versions(list_packages)}, 200
)
25 changes: 0 additions & 25 deletions blueprints/tools/validity_checker_inspect_file.json

This file was deleted.

Loading

0 comments on commit 4ef18af

Please sign in to comment.