Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

tests: Add test/integration/test_sfcli.py

Brendan Coles0d887dbc6dd7
diff --git a/test/integration/test_sfcli.py b/test/integration/test_sfcli.py
new file mode 100644
index 00000000..c4a0dcb6
--- /dev/null
+++ b/test/integration/test_sfcli.py
@@ -0,0 +1,25 @@
+# test_sfcli.py
+import subprocess
+import sys
+import unittest
+
+
+class TestSfcli(unittest.TestCase):
+ """
+ Test TestSfcli
+ """
+
+ def execute(self, command):
+ proc = subprocess.Popen(
+ command,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ )
+ out, err = proc.communicate()
+ return out, err, proc.returncode
+
+ def test_help_arg_should_print_help_and_exit(self):
+ out, err, code = self.execute([sys.executable, "sfcli.py", "-h"])
+ self.assertIn(b"show this help message and exit", out)
+ self.assertEqual(b"", err)
+ self.assertEqual(0, code)
diff --git a/test/unit/test_spiderfootcli.py b/test/unit/test_spiderfootcli.py
index 6efe2d01..3facad83 100644
--- a/test/unit/test_spiderfootcli.py
+++ b/test/unit/test_spiderfootcli.py
@@ -1,6 +1,5 @@
# test_spiderfootcli.py
import io
-import subprocess
import sys
import unittest
@@ -27,21 +26,6 @@ class TestSpiderFootCli(unittest.TestCase):
"cli.server_baseurl": "http://127.0.0.1:5001"
}
- def execute(self, command):
- proc = subprocess.Popen(
- command,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- )
- out, err = proc.communicate()
- return out, err, proc.returncode
-
- def test_help_arg_should_print_help_and_exit(self):
- out, err, code = self.execute([sys.executable, "sfcli.py", "-h"])
- self.assertIn(b"show this help message and exit", out)
- self.assertEqual(b"", err)
- self.assertEqual(0, code)
-
def test_default(self):
"""
Test default(self, line)