Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAntoine committed Dec 13, 2024
1 parent 09d40df commit 841e865
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions datascience/tests/test_pipeline/test_shared_tasks/test_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_make_alerts():
"INTERNAL_REFERENCE_NUMBER",
],
"risk_factor": [1.23, 3.56],
"creation_date": [date_1, date_2],
"triggering_behaviour_datetime_utc": [date_1, date_2],
"latitude": [9.8, -1.963],
"longitude": [65.59, -81.71],
"vessel_id": [1, 12],
Expand All @@ -194,7 +194,8 @@ def test_make_alerts():
"INTERNAL_REFERENCE_NUMBER",
"INTERNAL_REFERENCE_NUMBER",
],
"creation_date": [date_1, date_2],
"triggering_behaviour_datetime_utc": [date_1, date_2],
"creation_date": [datetime(2020, 5, 3, 8, 0, 0)] * 2,
"latitude": [9.8, -1.963],
"longitude": [65.59, -81.71],
"type": ["MISSING_FAR_ALERT", "MISSING_FAR_ALERT"],
Expand All @@ -217,14 +218,12 @@ def test_make_alerts():
"MISSING_FAR_ALERT_CONFIG_1",
],
}
).astype({"creation_date": "datetime64[ns]"})
).astype({"creation_date": "datetime64[us]"})

pd.testing.assert_frame_equal(alerts, expected_alerts)

# Without optional in input
vessels_in_alert = vessels_in_alert.drop(
columns=["creation_date", "latitude", "longitude"]
)
vessels_in_alert = vessels_in_alert.drop(columns=["latitude", "longitude"])
alerts = make_alerts.run(
vessels_in_alert,
alert_type="MISSING_FAR_ALERT",
Expand Down

0 comments on commit 841e865

Please sign in to comment.