Skip to content

Commit

Permalink
Update fluid generation unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eomielan committed Sep 23, 2024
1 parent 8c216a4 commit 8fc1866
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/boat_simulator/tests/unit/nodes/physics_engine/test_fluids.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class TestFluidGenerator:
@pytest.mark.parametrize(
"vector",
[
(np.array([1, 0])),
(np.array([0, 1])),
(np.array([1, 0])),
(np.array([1, 0, 1])),
(np.array([0, 1, 0])),
(np.array([1, 0, 0])),
],
)
def test_velocity_constant(self, vector):
Expand All @@ -26,10 +26,10 @@ def test_velocity_constant(self, vector):
@pytest.mark.parametrize(
"mean, cov",
[
(np.array([1, 2]), np.array([[2, 1], [1, 2]])),
(np.array([4, 5]), np.array([[3, 1], [1, 3]])),
(np.array([100, 50]), np.array([[10, 5], [5, 10]])),
(np.array([120, 130]), np.array([[10, 5], [5, 10]])),
(np.array([1, 2, 0]), np.array([[2, 1, 1], [1, 2, 2], [3, 1, 2]])),
(np.array([4, 5, 3]), np.array([[3, 1, 2], [1, 3, 2], [1, 2, 2]])),
(np.array([100, 50, 20]), np.array([[10, 5, 5], [5, 10, 1], [6, 2, 5]])),
(np.array([120, 130, 40]), np.array([[10, 5, 0], [5, 10, 2], [1, 3, 5]])),
],
)
def test_velocity_random(self, mean, cov):
Expand All @@ -42,12 +42,12 @@ def test_velocity_random(self, mean, cov):
@pytest.mark.parametrize(
"vector",
[
(np.array([1, 0])),
(np.array([0, 1])),
(np.array([-1, 0])),
(np.array([0, -1])),
(np.array([1, 1])),
(np.array([-1, -1])),
(np.array([1, 0, 1])),
(np.array([0, 1, 0])),
(np.array([-1, 0, 1])),
(np.array([0, -1, 0])),
(np.array([1, 1, 1])),
(np.array([-1, -1, -1])),
],
)
def test_speed(self, vector):
Expand All @@ -60,12 +60,12 @@ def test_speed(self, vector):
@pytest.mark.parametrize(
"vector, expected_direction",
[
(np.array([1, 0]), 0),
(np.array([0, 1]), 90),
(np.array([-1, 0]), -180),
(np.array([0, -1]), -90),
(np.array([1, 1]), 45),
(np.array([-1, -1]), -135),
(np.array([1, 0, 1]), 0),
(np.array([0, 1, -3]), 90),
(np.array([-1, 0, -1]), -180),
(np.array([0, -1, 0]), -90),
(np.array([1, 1, 4]), 45),
(np.array([-1, -1, 6]), -135),
],
)
def test_direction(self, vector, expected_direction):
Expand Down

0 comments on commit 8fc1866

Please sign in to comment.