-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule12_1.py
More file actions
33 lines (26 loc) · 803 Bytes
/
Copy pathmodule12_1.py
File metadata and controls
33 lines (26 loc) · 803 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
import unittest
from runner import *
class RunnerTest(unittest.TestCase):
def runTest(self):
self.test_walk()
self.test_run()
self.test_challenge()
def test_walk(self):
walker = Runner('Johnnie Walker')
for i in range(10):
walker.walk()
self.assertEqual(walker.distance, 50)
def test_run(self):
runner = Runner('Forrest')
for i in range(10):
runner.run()
self.assertEqual(runner.distance, 100)
def test_challenge(self):
runner1 = Runner('Beavis')
runner2 = Runner('Butthead')
for i in range(10):
runner1.run()
runner2.walk()
self.assertNotEqual(runner1.distance, runner2.distance)
if __name__ == "__main__":
unittest.main()