[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [stem/master] Unit test for misordered content
commit 7a13a14c337ecf30162e82d75c904910af884b11
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date: Sat Sep 22 18:06:20 2012 -0700
Unit test for misordered content
I added a test a while back to check that we detect misorderd document
attributes, but it didn't pass at the time so I skipped it. The document
parsing rewrite is almost done so enabling the test.
---
test/unit/descriptor/networkstatus/document.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/test/unit/descriptor/networkstatus/document.py b/test/unit/descriptor/networkstatus/document.py
index 7570e8c..42d2842 100644
--- a/test/unit/descriptor/networkstatus/document.py
+++ b/test/unit/descriptor/networkstatus/document.py
@@ -214,12 +214,15 @@ class TestNetworkStatusDocument(unittest.TestCase):
Rearranges our descriptor fields.
"""
- self.skipTest("Needs a parser rewrite first")
for is_consensus in (True, False):
attr = {"vote-status": "consensus"} if is_consensus else {"vote-status": "vote"}
lines = get_network_status_document(attr).split("\n")
for i in xrange(len(lines) - 1):
+ # once we reach the crypto blob we're done since swapping those won't
+ # be detected
+ if lines[i].startswith("e1XH33"): break
+
# swaps this line with the one after it
test_lines = list(lines)
test_lines[i], test_lines[i + 1] = test_lines[i + 1], test_lines[i]
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits