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

[tor-commits] [stem/master] test_shorthand_aliases integ test broken



commit e4dc4e7560cc980257fdd96ba9b58c326b138af6
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Mar 7 13:08:07 2016 -0800

    test_shorthand_aliases integ test broken
    
    Our unit tests caused us to cache a Mock object rather than a
    DescriptorDownloader for our singleton. This in turn broke our later integ
    tests...
    
      ======================================================================
      ERROR: test_shorthand_aliases
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/atagar/Desktop/stem/test/runner.py", line 161, in wrapped
          return func(self, *args, **kwargs)
        File "/home/atagar/Desktop/stem/test/runner.py", line 178, in wrapped
          return func(self, *args, **kwargs)
        File "/home/atagar/Desktop/stem/test/integ/descriptor/remote.py", line 31, in test_shorthand_aliases
          desc = list(stem.descriptor.remote.get_server_descriptors('9695DFC35FFEB861329B9F1AB04C46397020CE31').run())[0]
      IndexError: list index out of range
---
 test/unit/tutorial.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/unit/tutorial.py b/test/unit/tutorial.py
index 3c5bfd6..ac0bdd4 100644
--- a/test/unit/tutorial.py
+++ b/test/unit/tutorial.py
@@ -5,6 +5,8 @@ Tests for the examples given in stem's tutorial.
 import io
 import unittest
 
+import stem.descriptor.remote
+
 from stem.control import Controller
 from stem.descriptor.reader import DescriptorReader
 from stem.descriptor.server_descriptor import RelayDescriptor
@@ -38,6 +40,12 @@ MIRROR_MIRROR_OUTPUT = """\
 
 
 class TestTutorial(unittest.TestCase):
+  def tearDown(self):
+    # Ensure we don't cache a Mock object as our downloader. Otherwise future
+    # tests will understandably be very sad. :P
+
+    stem.descriptor.remote.SINGLETON_DOWNLOADER = None
+
   @patch('sys.stdout', new_callable = StringIO)
   @patch('stem.control.Controller.from_port', spec = Controller)
   def test_the_little_relay_that_could(self, from_port_mock, stdout_mock):

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