-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_models.py
More file actions
43 lines (30 loc) · 1.33 KB
/
Copy pathtest_models.py
File metadata and controls
43 lines (30 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Tests for statistics functions within the Model layer."""
import numpy as np
import numpy.testing as npt
def test_daily_mean_zeros():
"""Test that mean function works for an array of zeros."""
from inflammation.models import daily_mean
test_input = np.array([[0, 0],
[0, 0],
[0, 0]])
test_result = np.array([0, 0])
# Need to use Numpy testing functions to compare arrays
npt.assert_array_equal(daily_mean(test_input), test_result)
def test_daily_mean_integers():
"""Test that mean function works for an array of positive integers."""
from inflammation.models import daily_mean
test_input = np.array([[1, 2],
[3, 4],
[5, 6]])
test_result = np.array([3, 4])
# Need to use Numpy testing functions to compare arrays
npt.assert_array_equal(daily_mean(test_input), test_result)
def test_daily_min_integers():
""" Test that min function words for an array of positive intgers"""
from inflammation.models import daily_min
test_input = np.array([[1, 2],
[3, 4],
[5, 6]])
test_result = np.array([1, 2])
# Need to use Numpy testing functions to compare arrays
npt.assert_array_equal(daily_min(test_input), test_result)