Skip to content

Commit cfa825c

Browse files
committed
Merge branch 'water-level-csv' into water-level-csv-refactor
2 parents a8bd3ef + afb4af5 commit cfa825c

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

schemas/well_inventory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def email_validator_function(email_str):
130130
OptionalFloat: TypeAlias = Annotated[
131131
Optional[float], BeforeValidator(empty_str_to_none)
132132
]
133-
MonitoryFrequencyField: TypeAlias = Annotated[
133+
MonitoringFrequencyField: TypeAlias = Annotated[
134134
Optional[MonitoringFrequency], BeforeValidator(blank_to_none)
135135
]
136136
WellPurposeField: TypeAlias = Annotated[
@@ -249,7 +249,7 @@ class WellInventoryRow(BaseModel):
249249
well_purpose: WellPurposeField = None
250250
well_purpose_2: WellPurposeField = None
251251
well_hole_status: Optional[str] = None
252-
monitoring_frequency: MonitoryFrequencyField = None
252+
monitoring_frequency: MonitoringFrequencyField = None
253253

254254
result_communication_preference: Optional[str] = None
255255
contact_special_requests_notes: Optional[str] = None

tests/test_well_inventory.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
amp_viewer_function,
2626
)
2727
from db import (
28-
Group,
2928
Location,
3029
LocationThingAssociation,
3130
Thing,
@@ -87,8 +86,7 @@ def test_well_inventory_db_contents():
8786
"/well-inventory-csv",
8887
files={"file": open(file, "rb")},
8988
)
90-
data = response.json()
91-
print(data)
89+
9290
assert (
9391
response.status_code == 201
9492
), f"Unexpected status code: {response.status_code}"
@@ -237,6 +235,18 @@ def test_well_inventory_db_contents():
237235
== "true"
238236
)
239237

238+
assert thing.well_status == file_content["well_hole_status"]
239+
assert (
240+
thing.datalogger_suitability_status == "Datalogger can be installed"
241+
if file_content["datalogger_possible"].lower() == "true"
242+
else "Datalogger cannot be installed"
243+
)
244+
assert (
245+
thing.open_status == "Open"
246+
if file_content["is_open"].lower() == "true"
247+
else "Closed"
248+
)
249+
240250
# LOCATION AND RELATED RECORDS
241251
location_thing_association = (
242252
session.query(LocationThingAssociation)

0 commit comments

Comments
 (0)