comparison tests/test_fail.py @ 3:d3a4f7b41944

add a stub test
author Jeff Hammel <k0scist@gmail.com>
date Tue, 23 Aug 2016 15:39:06 -0700
parents
children
comparison
equal deleted inserted replaced
2:d1880117acb5 3:d3a4f7b41944
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 """
5 unit tests for fail
6 """
7
8 # imports
9 import os
10 import subprocess
11 import sys
12 import tempfile
13 import unittest
14
15 # module globals
16 here = os.path.dirname(os.path.abspath(__file__))
17 fail_command = 'fail'
18
19 class FailUnitTest(unittest.TestCase):
20
21 def test_subprocess(self):
22 """test fail invocation"""
23 process = subprocess.Popen([fail_command, 'false'])
24 process.communicate()
25 self.assertEqual(process.returncode, 1)
26
27 if __name__ == '__main__':
28 unittest.main()
29