Mercurial > hg > periprocess
annotate tests/test_periprocess.py @ 0:d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Wed, 30 Nov 2016 12:40:25 -0800 |
parents | |
children |
rev | line source |
---|---|
0
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
3 |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
4 """ |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
5 unit tests for periprocess |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
6 """ |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
7 |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
8 import os |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
9 import sys |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
10 import tempfile |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
11 import unittest |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
12 |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
13 # globals |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
14 here = os.path.dirname(os.path.abspath(__file__)) |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
15 |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
16 class periprocessUnitTest(unittest.TestCase): |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
17 |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
18 def test_periprocess(self): |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
19 tf = tempfile.mktemp() |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
20 try: |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
21 # pass |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
22 pass |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
23 finally: |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
24 if os.path.exists(tf): |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
25 os.remove(tf) |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
26 |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
27 if __name__ == '__main__': |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
28 unittest.main() |
d28351df9a8a
initial commit from http://k0s.org/hg/config/file/tip/python/example/process.py
Jeff Hammel <k0scist@gmail.com>
parents:
diff
changeset
|
29 |