Skip to content
Snippets Groups Projects
Commit ff0fad14 authored by Raphael's avatar Raphael
Browse files

test

parent 77a9bdf2
No related branches found
No related tags found
3 merge requests!15Resolve "normalisation should raise exception when bad arguments given",!14Resolve "normalisation should raise exception when bad arguments given",!13Draft: Develop
This commit is part of merge request !13. Comments created here will be created in the context of that merge request.
...@@ -216,6 +216,40 @@ class TestAISPositions(unittest.TestCase): ...@@ -216,6 +216,40 @@ class TestAISPositions(unittest.TestCase):
pd.testing.assert_frame_equal(expected.reset_index(drop=True), result.reset_index(drop=True), pd.testing.assert_frame_equal(expected.reset_index(drop=True), result.reset_index(drop=True),
check_exact=False, rtol=0.05) 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): def test_compute_drift(self):
ais_points = AISPoints(pd.DataFrame( ais_points = AISPoints(pd.DataFrame(
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment