[tor-commits] [stem/master] Unit test for misordered content

atagar at torproject.org atagar at torproject.org
Sat Oct 13 18:35:45 UTC 2012


commit 7a13a14c337ecf30162e82d75c904910af884b11
Author: Damian Johnson <atagar at torproject.org>
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]





More information about the tor-commits mailing list