Skip to content

Commit

Permalink
doc(test): add todos for occhab impor test
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Feb 20, 2024
1 parent 9aea5a2 commit f2b9f31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def check_transient_data(task, logger, imprt):
geom_local_field=fields["geom_local"],
)
if imprt.fieldmapping.get("altitudes_generate", False):
# [email protected]_import_valid_file: add testcase
generate_altitudes(
imprt, fields["the_geom_local"], fields["altitude_min"], fields["altitude_max"]
)
Expand All @@ -160,6 +161,7 @@ def check_transient_data(task, logger, imprt):
)
if "WKT" in selected_fields:
check_is_valid_geography(imprt, entity, selected_fields["WKT"], fields["geom_4326"])
# [email protected]_import_valid_file: remove this check
if current_app.config["IMPORT"]["ID_AREA_RESTRICTION"]:
check_geography_outside(
imprt,
Expand Down Expand Up @@ -236,6 +238,7 @@ def import_data_to_occhab(imprt):
continue
field = fields[field_name]
if field.multi:
# [email protected]_import_valid_file: add testcase
if not set(source_field).isdisjoint(imprt.columns):
insert_fields |= {field}
else:
Expand All @@ -246,6 +249,7 @@ def import_data_to_occhab(imprt):
insert_fields -= {fields["unique_dataset_id"]}
insert_fields |= {fields["id_dataset"]}
insert_fields |= {fields["geom_4326"], fields["geom_local"]}
# [email protected]_import_valid_file: add testcase
if imprt.fieldmapping.get("altitudes_generate", False):
insert_fields |= {fields["altitude_min"], fields["altitude_max"]}
# FIXME:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Meta:
observers = Nested(UserSchema, unknown=EXCLUDE, many=True)
dataset = Nested(DatasetSchema, dump_only=True)

# [email protected]_import_valid_file: maybe add testcase
@validates_schema
def validate_habitats(self, data, **kwargs):
"""
Expand Down

0 comments on commit f2b9f31

Please sign in to comment.