[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Fix unit tests



commit c138aa193350012ea97a6e7397fdd74661946981
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Wed Feb 1 09:09:04 2017 -0800

    Fix unit tests
    
    Huh. Not sure why these didn't come up on my netbook. Moving resources broke
    three of our tests.
---
 test/unit/descriptor/extrainfo_descriptor.py      | 2 +-
 test/unit/descriptor/networkstatus/document_v3.py | 2 +-
 test/unit/descriptor/router_status_entry.py       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/unit/descriptor/extrainfo_descriptor.py b/test/unit/descriptor/extrainfo_descriptor.py
index ce898d3..8dc4130 100644
--- a/test/unit/descriptor/extrainfo_descriptor.py
+++ b/test/unit/descriptor/extrainfo_descriptor.py
@@ -171,7 +171,7 @@ k0d2aofcVbHr4fPQOSST0LXDrhFl5Fqo5um296zpJGvRUeO6S44U/EfJAGShtqWw
     Malformed descriptor with non-ascii content for the 'dirreq-v3-reqs' line.
     """
 
-    with open(get_resource('extrainfo_nonascii_v3_reqs'), 'rb') as descriptor_file:
+    with open(get_resource('unparseable/extrainfo_nonascii_v3_reqs'), 'rb') as descriptor_file:
       try:
         next(stem.descriptor.parse_file(descriptor_file, 'extra-info 1.0', validate = True))
         self.fail("validation should've raised an exception")
diff --git a/test/unit/descriptor/networkstatus/document_v3.py b/test/unit/descriptor/networkstatus/document_v3.py
index f34bcc8..a3da8a4 100644
--- a/test/unit/descriptor/networkstatus/document_v3.py
+++ b/test/unit/descriptor/networkstatus/document_v3.py
@@ -240,7 +240,7 @@ JZ/1HL9sHyZfo6bwaC6YSM9PNiiY6L7rnGpS7UkHiFI+M96VCMorvjm5YPs3FioJ
 DnN5aFtYKiTc19qIC7Nmo+afPdDEf0MlJvEOP5EWl3w=
 -----END SIGNATURE-----"""
 
-    with open(get_resource('vote'), 'rb') as descriptor_file:
+    with open(get_resource('unparseable/vote'), 'rb') as descriptor_file:
       document = stem.descriptor.networkstatus.NetworkStatusDocumentV3(descriptor_file.read(), default_params = False)
 
       self.assertEqual(3, document.version)
diff --git a/test/unit/descriptor/router_status_entry.py b/test/unit/descriptor/router_status_entry.py
index fc02539..43bcaee 100644
--- a/test/unit/descriptor/router_status_entry.py
+++ b/test/unit/descriptor/router_status_entry.py
@@ -629,7 +629,7 @@ class TestRouterStatusEntry(unittest.TestCase):
     Read a descriptor file with windows newlines (CRLF).
     """
 
-    descriptor_path = get_resource('cached-microdesc-consensus_with_carriage_returns')
+    descriptor_path = get_resource('unparseable/cached-microdesc-consensus_with_carriage_returns')
 
     with open(descriptor_path, 'rb') as descriptor_file:
       descriptors = stem.descriptor.parse_file(descriptor_file, 'network-status-microdesc-consensus-3 1.0', normalize_newlines = True)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits