[tor-commits] [stem/master] Move test_get_socks_listeners_*() methods up in module
atagar at torproject.org
atagar at torproject.org
Sun Jan 6 23:09:08 UTC 2013
commit e70af604c1716d6baff3e0e908ecc94e861b2fd3
Author: Sean Robinson <seankrobinson at gmail.com>
Date: Sat Jan 5 14:21:36 2013 -0700
Move test_get_socks_listeners_*() methods up in module
Controller.get_socks_listeners() is next after get_version().
Signed-off-by: Sean Robinson <seankrobinson at gmail.com>
---
test/unit/control/controller.py | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/test/unit/control/controller.py b/test/unit/control/controller.py
index 44b7543..f25b218 100644
--- a/test/unit/control/controller.py
+++ b/test/unit/control/controller.py
@@ -66,24 +66,6 @@ class TestControl(unittest.TestCase):
# Turn caching back on before we leave.
self.controller._is_caching_enabled = True
- def test_event_listening(self):
- """
- Exercises the add_event_listener and remove_event_listener methods.
- """
-
- # set up for failure to create any events
- mocking.mock_method(Controller, "get_version", mocking.return_value(stem.version.Version('0.1.0.14')))
- self.assertRaises(InvalidRequest, self.controller.add_event_listener, mocking.no_op(), EventType.BW)
-
- # set up to only fail newer events
- mocking.mock_method(Controller, "get_version", mocking.return_value(stem.version.Version('0.2.0.35')))
-
- # EventType.BW is one of the earliest events
- self.controller.add_event_listener(mocking.no_op(), EventType.BW)
-
- # EventType.SIGNAL was added in tor version 0.2.3.1-alpha
- self.assertRaises(InvalidRequest, self.controller.add_event_listener, mocking.no_op(), EventType.SIGNAL)
-
def test_get_socks_listeners_old(self):
"""
Exercises the get_socks_listeners() method as though talking to an old tor
@@ -175,6 +157,24 @@ class TestControl(unittest.TestCase):
mocking.mock_method(Controller, "get_info", mocking.return_value(response))
self.assertRaises(stem.ProtocolError, self.controller.get_socks_listeners)
+ def test_event_listening(self):
+ """
+ Exercises the add_event_listener and remove_event_listener methods.
+ """
+
+ # set up for failure to create any events
+ mocking.mock_method(Controller, "get_version", mocking.return_value(stem.version.Version('0.1.0.14')))
+ self.assertRaises(InvalidRequest, self.controller.add_event_listener, mocking.no_op(), EventType.BW)
+
+ # set up to only fail newer events
+ mocking.mock_method(Controller, "get_version", mocking.return_value(stem.version.Version('0.2.0.35')))
+
+ # EventType.BW is one of the earliest events
+ self.controller.add_event_listener(mocking.no_op(), EventType.BW)
+
+ # EventType.SIGNAL was added in tor version 0.2.3.1-alpha
+ self.assertRaises(InvalidRequest, self.controller.add_event_listener, mocking.no_op(), EventType.SIGNAL)
+
def test_get_streams(self):
"""
Exercises the get_streams() method.
More information about the tor-commits
mailing list