-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathunitTestHunk.py
More file actions
39 lines (27 loc) · 987 Bytes
/
unitTestHunk.py
File metadata and controls
39 lines (27 loc) · 987 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
# description:
# TODO state the problem here
# ------------------------------------------------------------------------------
# idea:
# TODO describe the approach wanted to solve the task
# ------------------------------------------------------------------------------
# dummy function
def lookAndSay(n):
# todo description of the method
if n == 1:
return 1
pass
# ------------------------------------------------------------------------------
# proper unit-test
import unittest
class Testcase(unittest.TestCase):
def test_givenExample0(self):
n = 1
expectedOutput = 1
computedOutput = lookAndSay(n)
self.assertEqual(expectedOutput, computedOutput)
def test_expectFail(self):
self.assertFalse(1 < 0, "hell has frozen over")
# ---- here comes the execution of the unit-tests ----
if __name__ == '__main__':
unittest.main()
# ------------------------------------------------------------------------------