Skip to content

Commit 284fdeb

Browse files
committed
feat: update DataReliability test to use lexicon mapper and remove obsolete mapping
1 parent a05739a commit 284fdeb

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

tests/test_transfer_legacy_dates.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ def test_make_location_with_site_date_later_than_date_created(mock_lexicon_mappe
147147
assert location.nma_site_date == datetime.date(2015, 6, 20)
148148

149149

150-
def test_make_location_maps_data_reliability_code():
151-
"""DataReliability codes should map to lexicon terms."""
150+
def test_make_location_maps_data_reliability_code(mock_lexicon_mapper):
151+
"""DataReliability codes should map via the lexicon mapper."""
152152
row = pd.Series(
153153
{
154154
"PointID": "TEST-DR",
@@ -169,10 +169,8 @@ def test_make_location_maps_data_reliability_code():
169169
)
170170

171171
location, elevation_method, location_notes = make_location(row, {})
172-
assert (
173-
location.nma_data_reliability
174-
== "Data not field checked, but considered reliable"
175-
)
172+
mock_lexicon_mapper.map_value.assert_called_once_with("LU_DataReliability:U")
173+
assert location.nma_data_reliability == mock_lexicon_mapper.map_value.return_value
176174

177175

178176
def test_make_location_with_very_old_site_date(mock_lexicon_mapper):

transfers/util.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@
5656
"T": (10, "second"),
5757
}
5858

59-
DATA_RELIABILITY_MAP = {
60-
"C": "Data field checked by reporting agency",
61-
"L": "Location not correct",
62-
"M": "Minimal data",
63-
"U": "Data not field checked, but considered reliable",
64-
}
65-
6659

6760
class MeasuringPointEstimator:
6861
def __init__(self):

0 commit comments

Comments
 (0)