changeset 3:d3a4f7b41944

add a stub test
author Jeff Hammel <k0scist@gmail.com>
date Tue, 23 Aug 2016 15:39:06 -0700
parents d1880117acb5
children 8dc420754023
files tests/test_fail.py
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_fail.py	Tue Aug 23 15:39:06 2016 -0700
@@ -0,0 +1,29 @@
+#!/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()
+