[tor-commits] [stem/master] Unit test event_summary()
atagar at torproject.org
atagar at torproject.org
Sun May 22 01:40:51 UTC 2016
commit ececfb0f8db47599b13b1e2f26281934d51d804a
Author: Damian Johnson <atagar at torproject.org>
Date: Fri May 20 08:38:47 2016 -0700
Unit test event_summary()
This is a trivial function to unit test. No reason not to have coverage!
---
test/unit/control/controller.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/test/unit/control/controller.py b/test/unit/control/controller.py
index 58df2d4..1b61e4d 100644
--- a/test/unit/control/controller.py
+++ b/test/unit/control/controller.py
@@ -34,6 +34,11 @@ class TestControl(unittest.TestCase):
with patch('stem.control.Controller.add_event_listener', Mock()):
self.controller = Controller(socket)
+ def test_event_summary(self):
+ self.assertEqual('Tor debug logging event.', stem.control.event_summary('DEBUG'))
+ self.assertEqual('Event emitted every second with the bytes sent and received by tor.', stem.control.event_summary('BW'))
+ self.assertEqual('Event emitted every second with the bytes sent and received by tor.', stem.control.event_summary('bw'))
+
@patch('stem.control.Controller.get_info')
def test_get_version(self, get_info_mock):
"""
More information about the tor-commits
mailing list