annotate makeitso/python_package/tests/test_{{package}}.py @ 203:84be91d59996

STUB: makeitso/python_package/tests/test_{{package}}.py
author Jeff Hammel <k0scist@gmail.com>
date Tue, 12 Aug 2014 14:53:55 -0700
parents 2d009a183d53
children f7f7831f7c8c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
147
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 unit tests
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 """
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 import os
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 import sys
202
2d009a183d53 STUB: makeitso/python_package/tests/test_{{package}}.py
Jeff Hammel <k0scist@gmail.com>
parents: 193
diff changeset
9 import tempfile
147
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 import unittest
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 # globals
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 here = os.path.dirname(os.path.abspath(__file__))
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14
148
e3ba71e7b927 correct capitalization
Jeff Hammel <jhammel@mozilla.com>
parents: 147
diff changeset
15 class {{package}}UnitTest(unittest.TestCase):
147
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 def test_{{package}}(self):
203
84be91d59996 STUB: makeitso/python_package/tests/test_{{package}}.py
Jeff Hammel <k0scist@gmail.com>
parents: 202
diff changeset
18 tf = tempfile.mktemp()
84be91d59996 STUB: makeitso/python_package/tests/test_{{package}}.py
Jeff Hammel <k0scist@gmail.com>
parents: 202
diff changeset
19 try:
84be91d59996 STUB: makeitso/python_package/tests/test_{{package}}.py
Jeff Hammel <k0scist@gmail.com>
parents: 202
diff changeset
20 # pass
84be91d59996 STUB: makeitso/python_package/tests/test_{{package}}.py
Jeff Hammel <k0scist@gmail.com>
parents: 202
diff changeset
21 pass
84be91d59996 STUB: makeitso/python_package/tests/test_{{package}}.py
Jeff Hammel <k0scist@gmail.com>
parents: 202
diff changeset
22 finally:
84be91d59996 STUB: makeitso/python_package/tests/test_{{package}}.py
Jeff Hammel <k0scist@gmail.com>
parents: 202
diff changeset
23 if os.path.exists(tf):
84be91d59996 STUB: makeitso/python_package/tests/test_{{package}}.py
Jeff Hammel <k0scist@gmail.com>
parents: 202
diff changeset
24 os.remove(tf)
147
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 if __name__ == '__main__':
bdf4049e83ea add a unit test skeleton
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 unittest.main()