[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Dropped a necessary permission mock



commit 42e251ed24cf5d85c7ea56cc87b101f8952c8122
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Tue Feb 17 09:46:01 2015 -0800

    Dropped a necessary permission mock
    
    Not sure why this was dropped. Necessary since otherwise we check proc read
    permissions.
---
 test/unit/util/connection.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/unit/util/connection.py b/test/unit/util/connection.py
index eba0f03..c63f97f 100644
--- a/test/unit/util/connection.py
+++ b/test/unit/util/connection.py
@@ -117,15 +117,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([Resolver.NETSTAT_WINDOWS], stem.util.connection.system_resolvers('Windows'))
     self.assertEqual([Resolver.LSOF], stem.util.connection.system_resolvers('Darwin'))
@@ -136,7 +138,7 @@ class TestConnection(unittest.TestCase):
     proc_mock.return_value = True
     self.assertEqual([Resolver.PROC, Resolver.NETSTAT, Resolver.SOCKSTAT, Resolver.LSOF, Resolver.SS], stem.util.connection.system_resolvers('Linux'))
 
-    # check that calling without an argument is equivilant to calling for this
+    # check that calling without an argument is equivalent to calling for this
     # platform
 
     self.assertEqual(stem.util.connection.system_resolvers(platform.system()), stem.util.connection.system_resolvers())



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits