[tor-commits] [stem/master] Updating test for the network status example
atagar at torproject.org
atagar at torproject.org
Fri Jan 18 17:26:58 UTC 2013
commit 42ddd84ce3106d350890db064c631eaafe9b8d17
Author: Damian Johnson <atagar at torproject.org>
Date: Fri Jan 18 08:48:57 2013 -0800
Updating test for the network status example
I change one of the pydoc examples in the networkstatus module to use
stem.descriptor.parse_file() rather than the module's (now private) parse_file
method. Updating the unit test for this example.
Updating this test has the side benefit that it now gives us test coverage of
the descriptor_type argument (I had missed that previously).
---
test/unit/descriptor/networkstatus/document_v3.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/unit/descriptor/networkstatus/document_v3.py b/test/unit/descriptor/networkstatus/document_v3.py
index c4180d7..b1cc74e 100644
--- a/test/unit/descriptor/networkstatus/document_v3.py
+++ b/test/unit/descriptor/networkstatus/document_v3.py
@@ -8,6 +8,7 @@ import datetime
import StringIO
import unittest
+import stem.descriptor
import stem.version
from stem import Flag
@@ -123,10 +124,10 @@ class TestNetworkStatusDocument(unittest.TestCase):
for router in consensus.routers:
self.assertEqual('caerSidi', router.nickname)
- # second example: using _parse_file
+ # second example: using stem.descriptor.parse_file
with support_with(StringIO.StringIO(content)) as consensus_file:
- for router in _parse_file(consensus_file):
+ for router in stem.descriptor.parse_file(consensus_file, 'network-status-consensus-3 1.0'):
self.assertEqual('caerSidi', router.nickname)
def test_parse_file(self):
More information about the tor-commits
mailing list