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

[tor-commits] [stem/master] get_listener() integ test broke for older tor versions



commit 0be767b7149bfbee579b00ad513217ec51b0e31c
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Thu Aug 6 17:24:47 2020 -0700

    get_listener() integ test broke for older tor versions
    
    Oops, adjusting this assertion in commit 435b980c broke our tests for prior tor
    versions. Caught thanks to asn.
    
      12:42 <+asn> AssertionError: Lists differ: [('0.0.0.0', 1113), ('::', 1113)]
        != [('0.0.0.0', 1113)]
      ...
      20:06 <+atagar> asn, nickm: Thanks for pointing out the stem test assertion
        error. I'd like to approach this via a conditional. What was the tor
        version where the address behavior changed?
      21:38 <+nickm> atagar: somewhere in 0.4.5.x
      21:38 <+nickm> I believe that ">= 0.4.5.0" will do fine
      21:42 <+nickm> (since 0.4.5.1 isn't out yet)
      21:48 <+atagar> perfect, thanks
---
 test/integ/control/controller.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index 25566229..59a7222c 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -980,7 +980,12 @@ class TestController(unittest.TestCase):
     runner = test.runner.get_runner()
 
     async with await runner.get_tor_controller() as controller:
-      self.assertEqual([('0.0.0.0', test.runner.ORPORT), ('::', test.runner.ORPORT)], await controller.get_listeners(Listener.OR))
+      if test.tor_version() >= stem.version.Version('0.4.5.0'):
+        expected_orports = [('0.0.0.0', test.runner.ORPORT), ('::', test.runner.ORPORT)]
+      else:
+        expected_orports = [('0.0.0.0', test.runner.ORPORT)]
+
+      self.assertEqual(expected_orports, await controller.get_listeners(Listener.OR))
       self.assertEqual([], await controller.get_listeners(Listener.DIR))
       self.assertEqual([('127.0.0.1', test.runner.SOCKS_PORT)], await controller.get_listeners(Listener.SOCKS))
       self.assertEqual([], await controller.get_listeners(Listener.TRANS))

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