forked from UWPCE-PythonCert/IntroPython-2017
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_codingbat.py
More file actions
executable file
·43 lines (26 loc) · 799 Bytes
/
Copy pathtest_codingbat.py
File metadata and controls
executable file
·43 lines (26 loc) · 799 Bytes
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
#!/usr/bin/env python
"""
test file for codingbat module
This version can be run with nose or py.test
"""
from codingbat import sleep_in, monkey_trouble
# tests for sleep_in
def test_false_false():
assert sleep_in(False, False)
def test_true_false():
assert not (sleep_in(True, False))
def test_false_true():
assert sleep_in(False, True)
def test_true_true():
assert sleep_in(True, True)
# put tests for monkey_trouble here
# monkey_trouble(True, True) → True
# monkey_trouble(False, False) → True
# monkey_trouble(True, False) → False
def test_monkey_true_true():
assert monkey_trouble(True, True)
def test_monkey_false_false():
assert monkey_trouble(False, False)
def test_monkey_true_false():
assert monkey_trouble(True, False) is False
# more!