[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] Add test that calls sbws init



commit 43856fdbe3d242396b3c9f6533bd20b9d1c5ec27
Author: Matt Traudt <sirmatt@xxxxxxx>
Date:   Wed Jul 4 12:33:13 2018 -0400

    Add test that calls sbws init
---
 tests/integration/test_sbws.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tests/integration/test_sbws.py b/tests/integration/test_sbws.py
new file mode 100644
index 0000000..5122f38
--- /dev/null
+++ b/tests/integration/test_sbws.py
@@ -0,0 +1,22 @@
+from tempfile import TemporaryFile
+import subprocess
+import os
+
+
+def test_simple_init(tmpdir):
+    # out = None
+    err = None
+    with TemporaryFile('w+t') as stdout, TemporaryFile('w+t') as stderr:
+        retcode = subprocess.call(
+            'sbws -d {} --log-level debug init'.format(tmpdir).split(),
+            stdout=stdout, stderr=stderr)
+        stdout.seek(0, 0)
+        stderr.seek(0, 0)
+        # out = stdout.read()
+        err = stderr.read()
+    assert retcode == 0
+    assert len(err) == 0
+    conf_fname = os.path.join(str(tmpdir), 'config.ini')
+    assert os.path.exists(conf_fname)
+    with open(conf_fname, 'rt') as fd:
+        assert len(fd.read()) > 0



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits