diff tests/test_console_scripts.py @ 0:5dba84370182

initial commit; half-working prototype
author Jeff Hammel <k0scist@gmail.com>
date Sat, 24 Jun 2017 12:03:39 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test_console_scripts.py	Sat Jun 24 12:03:39 2017 -0700
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+"""
+test console scripts
+"""
+
+import os
+import subprocess
+import unittest
+from globalneighbors import main
+
+here = os.path.dirname(os.path.abspath(__file__))
+data = os.path.join(here, 'data')
+
+
+class TestConsoleScripts(unittest.TestCase):
+
+    # path to full data
+    full_tsv = os.path.join(data, 'cities1000.txt')
+
+    def test_main(self):
+        """test main API"""
+
+        assert os.path.exists(self.full_tsv)
+        main.main(args=[self.full_tsv])
+
+    def test_subprocess(self):
+        """
+        test invoking `global-neighbors`
+        as a subprocess
+        """
+        # TODO
+
+
+if __name__ == '__main__':
+    unittest.main()