]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make test_cmdline_args.py work with older pythons
authorNick Mathewson <nickm@torproject.org>
Mon, 21 Oct 2013 18:33:52 +0000 (14:33 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 21 Oct 2013 18:35:01 +0000 (14:35 -0400)
I was using the assertIn() function on unit tests, which Python 2.7
introduced.  But we'd like to be able to run our unit tests on Pythons
from older operating systems.

src/test/test_cmdline_args.py

index 1b0963f6b9b921f271c24812726d48290e950e1e..2213bb5702b6a79a62d4e21de9e22fc4a64ac3af 100755 (executable)
@@ -163,9 +163,9 @@ class CmdlineTests(unittest.TestCase):
 
         out_fl = lines(out_fl)
         self.assert_(len(out_fl) > 100)
-        self.assertIn("SocksPort 9999", out_fl)
-        self.assertIn("SafeLogging 0", out_fl)
-        self.assertIn("ClientOnly 0", out_fl)
+        self.assert_("SocksPort 9999" in out_fl)
+        self.assert_("SafeLogging 0" in out_fl)
+        self.assert_("ClientOnly 0" in out_fl)
 
         self.assert_(out_verif.endswith("Configuration was valid\n"))