-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_utils.py
More file actions
41 lines (31 loc) · 1.11 KB
/
Copy pathtest_utils.py
File metadata and controls
41 lines (31 loc) · 1.11 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
from utils import maxvalue, meannvalue, minvalue, countvalue, sumvalues
def test_sumvalues_1():
# tests for one list
assert sumvalues([1,3,5,3,24,5]) == 41
def test_sumvalues_2():
# tests correct datatype is returned
assert type(sumvalues([1,2,34,23,24,3])) == int
def test_maxvalue_1():
# tests one list
assert maxvalue([1,3,5,3,24,5]) == 24
def test_maxvalue_2():
# tests that the correct datatype is returned
assert type(maxvalue([23,453,432,23,3])) == int
def test_minvalue_1():
# tests for one list
assert minvalue([1,3,5,3,24,5]) == 1
def test_minvalue_2():
#tests that the correct datatype is returned
assert type(minvalue([23,4,23,55,63,3]))== int
def test_meanvalue_1():
# tests for one list
assert meannvalue([1,2,3,4,5])==3
def test_meanvalue_2():
# tests that the datatype is correct
assert type(meannvalue([1,2,3,4,5]))==float
def test_countvalue_1():
# tests string
assert countvalue([1,2,3,4,1,1,1,1,2,3,4],1)==5
def test_countvalue_2():
#tests integer
assert countvalue(["No data",1,3,23,"No data",3,4,5,"No data"],"No data")