[tor-commits] [stem/master] Fix system resolved test on platforms without proc

atagar at torproject.org atagar at torproject.org
Tue Feb 10 05:24:02 UTC 2015


commit 9d644f4c18e8ec7a43591fdc2a8a140fad44571a
Author: Sebastian Hahn <sebastian at torproject.org>
Date:   Mon Feb 9 20:59:50 2015 +0100

    Fix system resolved test on platforms without proc
    
    This was broken when a hack was introduced for Gentoo in commit
    500fd38a7d09e883257d84dd67bc7014f4f47085.
---
 test/unit/util/connection.py |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/unit/util/connection.py b/test/unit/util/connection.py
index b6995d0..731fa5b 100644
--- a/test/unit/util/connection.py
+++ b/test/unit/util/connection.py
@@ -105,15 +105,17 @@ BSD_PROCSTAT_OUTPUT = """\
 
 
 class TestConnection(unittest.TestCase):
+  @patch('os.access')
   @patch('stem.util.system.is_available')
   @patch('stem.util.proc.is_available')
-  def test_system_resolvers(self, proc_mock, is_available_mock):
+  def test_system_resolvers(self, proc_mock, is_available_mock, os_mock):
     """
     Checks the system_resolvers function.
     """
 
     is_available_mock.return_value = True
     proc_mock.return_value = False
+    os_mock.return_value = True
 
     self.assertEqual([], stem.util.connection.system_resolvers('Windows'))
     self.assertEqual([Resolver.LSOF], stem.util.connection.system_resolvers('Darwin'))





More information about the tor-commits mailing list