Skip to content

Commit

Permalink
fix stupid typo
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienChampagnol committed Mar 13, 2024
1 parent 40df704 commit 786f4e3
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from src.opengeodeweb_back import geode_functions, geode_objects


data_folder = os.path.join(os.path.dirname(__file__), "data")


def test_geode_object_value():
for geode_object, value in geode_objects.geode_objects_dict().items():
geode_object_value = geode_functions.geode_object_value(geode_object)
Expand Down Expand Up @@ -39,7 +42,7 @@ def test_missing_files():
for geode_object, value in geode_objects.geode_objects_dict().items():
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
for input_extension in input_extensions:
file_absolute_path = os.path.abspath(f"./tests/data/test.{input_extension}")
file_absolute_path = os.path.join(data_folder, f"test.{input_extension}")
missing_files = geode_functions.missing_files(
geode_object, file_absolute_path
)
Expand All @@ -55,7 +58,7 @@ def test_is_loadable():
for geode_object, value in geode_objects.geode_objects_dict().items():
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
for input_extension in input_extensions:
file_absolute_path = os.path.abspath(f"./tests/data/test.{input_extension}")
file_absolute_path = os.path.join(data_folder, f"test.{input_extension}")
is_loadable = geode_functions.is_loadable(geode_object, file_absolute_path)
assert type(is_loadable) is bool

Expand All @@ -66,18 +69,18 @@ def test_load():
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
for input_extension in input_extensions:
print(f"\t{input_extension=}")
file_absolute_path = os.path.join(data_folder, f"test.{input_extension}")
missing_files = geode_functions.missing_files(
geode_object, f"./tests/data/test.{input_extension}"
geode_object, file_absolute_path
)
has_missing_files = missing_files.has_missing_files()
if has_missing_files:
mandatory_files = missing_files.mandatory_files
print(f"\t\t{mandatory_files=}")
additional_files = missing_files.additional_files
print(f"\t\t{additional_files=}")
file_apsolute_path = os.path.abspath(f"tests/data/test.{input_extension}")
if geode_functions.is_loadable(geode_object, file_apsolute_path):
data = geode_functions.load(geode_object, file_apsolute_path)
if geode_functions.is_loadable(geode_object, file_absolute_path):
data = geode_functions.load(geode_object, file_absolute_path)
if "save_viewable" in value:
uu_id = str(uuid.uuid4()).replace("-", "")
viewable_file_path = geode_functions.save_viewable(
Expand Down Expand Up @@ -149,16 +152,17 @@ def test_geode_object_output_extensions():
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
for input_extension in input_extensions:
print(f"\t{input_extension=}")
file_absolute_path = os.path.join(data_folder, f"test.{input_extension}")
missing_files = geode_functions.missing_files(
geode_object, f"./tests/data/test.{input_extension}"
geode_object, file_absolute_path
)
has_missing_files = missing_files.has_missing_files()
if has_missing_files:
mandatory_files = missing_files.mandatory_files
print(f"\t\t{mandatory_files=}")
additional_files = missing_files.additional_files
print(f"\t\t{additional_files=}")
file_absolute_path = os.path.abspath(f"tests/data/test.{input_extension}")
file_absolute_path = os.path.join(data_folder, f"test.{input_extension}")
if geode_functions.is_loadable(geode_object, file_absolute_path):
data = geode_functions.load(geode_object, file_absolute_path)
geode_objets_and_output_extensions = (
Expand Down Expand Up @@ -227,8 +231,8 @@ def test_list_geode_objects():
input_extensions = geode_functions.list_input_extensions(key)
for geode_object, value in geode_objects.geode_objects_dict().items():
for input_extension in input_extensions:
file_absolute_path = os.path.abspath(
f"./tests/data/test.{input_extension}"
file_absolute_path = os.path.join(
data_folder, f"test.{input_extension}"
)
return_dict = geode_functions.list_geode_objects(
file_absolute_path, key
Expand All @@ -254,7 +258,7 @@ def test_geode_objects_output_extensions():
for geode_object, value in geode_objects.geode_objects_dict().items():
input_extensions = geode_functions.geode_object_input_extensions(geode_object)
for input_extension in input_extensions:
file_absolute_path = f"./tests/data/test.{input_extension}"
file_absolute_path = os.path.join(data_folder, f"test.{input_extension}")
if geode_functions.is_loadable(geode_object, file_absolute_path):
data = geode_functions.load(geode_object, file_absolute_path)
geode_objects_and_output_extensions = (
Expand Down

0 comments on commit 786f4e3

Please sign in to comment.