Skip to content

Commit 937cb5f

Browse files
committed
Add parameterisation mean, min, max test cases
1 parent ff94ee5 commit 937cb5f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_models.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Tests for statistics functions within the Model layer."""
22

33
import numpy as np
4+
import pytest
45
import numpy.testing as npt
56

67
from inflammation.models import daily_mean
@@ -51,3 +52,15 @@ def test_daily_min():
5152
test_result = np.array([-4, -6, 2])
5253

5354
npt.assert_array_equal(daily_min(test_input), test_result)
55+
56+
from inflammation.models import daily_mean
57+
58+
@pytest.mark.parametrize(
59+
"test, expected",
60+
[
61+
([ [0, 0], [0, 0], [0, 0] ], [0, 0]),
62+
([ [1, 2], [3, 4], [5, 6] ], [3, 4]),
63+
])
64+
def test_daily_mean(test, expected):
65+
"""Test mean function works for array of zeroes and positive integers."""
66+
npt.assert_array_equal(daily_mean(np.array(test)), np.array(expected))

0 commit comments

Comments
 (0)