[tor-commits] [stem/master] Test that 'tor --hush' only outputs warnings and errors

atagar at torproject.org atagar at torproject.org
Mon Feb 9 04:30:53 UTC 2015


commit c15d04d19addaeb5e0e1d3fca4a6ca9e8d7bb1f5
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Feb 2 10:17:53 2015 -0800

    Test that 'tor --hush' only outputs warnings and errors
    
    Simple port of test_cmdline_args.py's test_hush().
---
 test/integ/process.py |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/test/integ/process.py b/test/integ/process.py
index 47a9336..ef4182c 100644
--- a/test/integ/process.py
+++ b/test/integ/process.py
@@ -56,7 +56,20 @@ class TestProcess(unittest.TestCase):
     Check that we don't provide anything on stdout when running 'tor --quiet'.
     """
 
-    self.assertEqual('', self.run_tor('--quiet', '--invalid_argument', expect_failure = True))
+    self.assertEqual('', self.run_tor('--quiet', '--invalid_argument', 'true', expect_failure = True))
+
+  def test_hush_argument(self):
+    """
+    Check that we only get warnings and errors when running 'tor --hush'.
+    """
+
+    output = self.run_tor('--hush', '--invalid_argument', expect_failure = True)
+    self.assertTrue("[warn] Command-line option '--invalid_argument' with no value. Failing." in output)
+    self.assertTrue("[err] Reading config failed--see warnings above." in output)
+
+    output = self.run_tor('--hush', '--invalid_argument', 'true', expect_failure = True)
+    self.assertTrue("[warn] Failed to parse/validate config: Unknown option 'invalid_argument'.  Failing." in output)
+    self.assertTrue("[err] Reading config failed--see warnings above." in output)
 
   def test_launch_tor_with_config(self):
     """





More information about the tor-commits mailing list