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

[tor-commits] [stem/master] Drop duplicate collector_reading test



commit 05b005515e70f230b48851b0efa8fad58af95953
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Sep 27 16:14:12 2020 -0700

    Drop duplicate collector_reading test
    
    I wrote another test for collector_reading before realizing we already had
    coverage for several examples. Despite being years apart they amusingly were
    almost identical.
---
 test/unit/examples.py |  2 +-
 test/unit/tutorial.py | 11 -----------
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/test/unit/examples.py b/test/unit/examples.py
index 5b56261e..cadf3048 100644
--- a/test/unit/examples.py
+++ b/test/unit/examples.py
@@ -330,7 +330,7 @@ class TestExamples(unittest.TestCase):
 
     self.assertEqual(EXPECTED_COLLECTOR_CACHING, stdout_mock.getvalue())
 
-  @patch('stem.descriptor.collector.CollecTor.get_server_descriptors')
+  @patch('stem.descriptor.collector.get_server_descriptors')
   @patch('sys.stdout', new_callable = io.StringIO)
   def test_collector_reading(self, stdout_mock, server_desc_mock):
     server_desc_mock.return_value = [
diff --git a/test/unit/tutorial.py b/test/unit/tutorial.py
index d1093bd5..472285ad 100644
--- a/test/unit/tutorial.py
+++ b/test/unit/tutorial.py
@@ -130,17 +130,6 @@ class TestTutorial(unittest.TestCase):
     tutorial_example()
     self.assertEqual('found relay caerSidi (A7569A83B5706AB1B1A9CB52EFF7D2D32E4553EB)\n', stdout_mock.getvalue())
 
-  @patch('sys.stdout', new_callable = io.StringIO)
-  @patch('stem.descriptor.collector.get_server_descriptors')
-  def test_mirror_mirror_on_the_wall_4(self, get_desc_mock, stdout_mock):
-    get_desc_mock.return_value = iter([RelayDescriptor.create({
-      'router': 'caerSidi 71.35.133.197 9001 0 0',
-      'fingerprint': '2C3C 4662 5698 B6D6 7DF3 2BC1 918A D3EE 1F99 06B1',
-    }, exit_policy = ExitPolicy('accept *:*'), validate = False)])
-
-    exec_documentation_example('collector_reading.py')
-    self.assertEqual('1 relays published an exiting policy today...\n\n  caerSidi (2C3C46625698B6D67DF32BC1918AD3EE1F9906B1)\n', stdout_mock.getvalue())
-
   @patch('sys.stdout', new_callable = io.StringIO)
   @patch('stem.descriptor.remote.DescriptorDownloader')
   def test_mirror_mirror_on_the_wall_5(self, downloader_mock, stdout_mock):



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