view 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
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()