[tor-commits] [stem/master] Test that 'tor --help' provides the expected output

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


commit 367794c432b97b79102009ad550911c87f39fe34
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Feb 2 09:57:29 2015 -0800

    Test that 'tor --help' provides the expected output
    
    Simple port of test_cmdline_args.py's test_help().
---
 test/integ/process.py |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test/integ/process.py b/test/integ/process.py
index c449db3..47a9336 100644
--- a/test/integ/process.py
+++ b/test/integ/process.py
@@ -37,6 +37,20 @@ class TestProcess(unittest.TestCase):
     with test.runner.get_runner().get_tor_controller() as controller:
       self.assertEqual('Tor version %s.\n' % controller.get_version(), self.run_tor('--version'))
 
+  def test_help_argument(self):
+    """
+    Check that 'tor --help' provides the expected output.
+    """
+
+    help_output = self.run_tor('--help')
+
+    self.assertTrue(help_output.startswith('Copyright (c) 2001'))
+    self.assertTrue(help_output.endswith('tor -f <torrc> [args]\nSee man page for options, or https://www.torproject.org/ for documentation.\n'))
+
+    # should be an alias for 'tor -h'
+
+    self.assertEqual(help_output, self.run_tor('-h'))
+
   def test_quiet_argument(self):
     """
     Check that we don't provide anything on stdout when running 'tor --quiet'.





More information about the tor-commits mailing list