Mercurial > hg > fail
view tests/test_fail.py @ 4:8dc420754023
minor upgrades to prepare for streamlining
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 23 Aug 2016 16:29:13 -0700 |
parents | d3a4f7b41944 |
children |
line wrap: on
line source
#!/usr/bin/env python # -*- coding: utf-8 -*- """ unit tests for fail """ # imports import os import subprocess import sys import tempfile import unittest # module globals here = os.path.dirname(os.path.abspath(__file__)) fail_command = 'fail' class FailUnitTest(unittest.TestCase): def test_subprocess(self): """test fail invocation""" process = subprocess.Popen([fail_command, 'false']) process.communicate() self.assertEqual(process.returncode, 1) if __name__ == '__main__': unittest.main()