From ff0fad1451871efd2422e29b950f0c1397ff980c Mon Sep 17 00:00:00 2001 From: Raphael <raphael.sturgis@gmail.com> Date: Thu, 7 Apr 2022 13:32:43 +0200 Subject: [PATCH] test --- skais/tests/ais/test_ais_points.py | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/skais/tests/ais/test_ais_points.py b/skais/tests/ais/test_ais_points.py index 330f039..5930a9c 100644 --- a/skais/tests/ais/test_ais_points.py +++ b/skais/tests/ais/test_ais_points.py @@ -216,6 +216,40 @@ class TestAISPositions(unittest.TestCase): pd.testing.assert_frame_equal(expected.reset_index(drop=True), result.reset_index(drop=True), check_exact=False, rtol=0.05) + def test_normalize_wrong_arguments_1(self): + ais_points = AISPoints(pd.DataFrame( + { + "cog": [i for i in range(0, 359, 10)], + "heading": [180 for _ in range(0, 359, 10)] + } + ) + ) + + with self.assertRaises(ValueError): + ais_points.normalize(normalization_dict=None) + + def test_normalize_wrong_arguments_2(self): + ais_points = AISPoints(pd.DataFrame( + { + "cog": [i for i in range(0, 359, 10)], + "heading": [180 for _ in range(0, 359, 10)] + } + ) + ) + with self.assertRaises(ValueError): + ais_points.normalize(normalization_dict=10) + + def test_normalize_wrong_arguments_3(self): + ais_points = AISPoints(pd.DataFrame( + { + "cog": [i for i in range(0, 359, 10)], + "heading": [180 for _ in range(0, 359, 10)] + } + ) + ) + with self.assertRaises(ValueError): + ais_points.normalize(normalization_dict=[0, 1, 2, 3, 4]) + def test_compute_drift(self): ais_points = AISPoints(pd.DataFrame( { -- GitLab