[stem/master] Support lack of PATH in process tests

commit 3bf77ecf6e2d16eca768834f1e7da75e53eda6b0 Author: Damian Johnson <atagar@torproject.org> Date: Tue May 23 16:32:29 2017 -0700 Support lack of PATH in process tests When tor lacks a path it includes some extra warnings even with 'hush'... % env -i /home/atagar/Desktop/tor/tor/src/or/tor --hush --hash-password my_password May 23 16:26:42.518 [warn] Couldn't find $HOME environment variable while expanding "~/.tor"; defaulting to "". May 23 16:26:42.518 [warn] Default DataDirectory is "~/.tor". This expands to "/.tor", which is probably not what you want. Using "/usr/local/var/tor" instead 16:CE3C1D5DA52940C860464AB6A01198BCC65E5E20402ED4AC90955F260D Accounting for this in the test by just checking the last line. --- test/integ/process.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integ/process.py b/test/integ/process.py index 1ca0f70..95c14cb 100644 --- a/test/integ/process.py +++ b/test/integ/process.py @@ -96,8 +96,8 @@ class TestProcess(unittest.TestCase): hush to cut it down. """ - output = self.run_tor('--hush', '--hash-password', 'my_password') - self.assertTrue(re.match('^16:[0-9A-F]{58}\n$', output)) + output = self.run_tor('--hush', '--hash-password', 'my_password').splitlines()[-1] + self.assertTrue(re.match('^16:[0-9A-F]{58}$', output)) # I'm not gonna even pretend to understand the following. Ported directly # from tor's test_cmdline_args.py.
participants (1)
-
atagar@torproject.org