unittest_template.py
1.01 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
""" Test my new feature
Some more info if you want
Should work with python2 and python3!
"""
import unittest
# if you need data from oletools/test-data/DIR/, uncomment these lines:
#from os.path import join, dirname, normpath
#Directory with test data, independent of current working directory
#DATA_DIR = normpath(join(dirname(__file__), '..', 'test-data', 'DIR'))
class TestMyFeature(unittest.TestCase):
""" Tests my cool new feature """
def test_this(self):
""" check that this works """
pass # your code here
def test_that(self):
""" check that that also works """
pass # your code here
def helper_function(self, filename):
""" to be called from other test functions to avoid copy-and-paste
this is not called by unittest directly, only from your functions """
pass # your code here
# e.g.: msodde.main(join(DATA_DIR, filename))
# just in case somebody calls this file as a script
if __name__ == '__main__':
unittest.main()