[tor-commits] [arm/release] fix: connection resolution test was nonfunctional

atagar at torproject.org atagar at torproject.org
Sun Jul 17 06:08:18 UTC 2011


commit 8364fc6a47238053738cce70f3cf9debe0cfb088
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon May 9 08:28:47 2011 -0700

    fix: connection resolution test was nonfunctional
    
    The second test (running targeted connection resolvers) was broken due to
    changes in the connection util.
---
 src/test.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/test.py b/src/test.py
index e403076..af80879 100644
--- a/src/test.py
+++ b/src/test.py
@@ -78,9 +78,9 @@ while True:
         printDivider()
         break
       
-      if userSelection.isdigit() and int(userSelection) in range(1, 8):
+      if userSelection.isdigit() and int(userSelection) in range(0, 7):
         try:
-          resolver = int(userSelection)
+          resolver = connections.Resolver.values()[int(userSelection)]
           startTime = time.time()
           
           print(connections.getResolverCommand(resolver, "tor", conn.getMyPid()))
@@ -93,7 +93,7 @@ while True:
             print("  %s:%s -> %s:%s" % (lIp, lPort, fIp, fPort))
           
           print("\n  Runtime: %0.4f seconds" % (time.time() - startTime))
-        except IOError, exc:
+        except (IOError, IndexError), exc:
           print exc
       else:
         print("'%s' isn't a valid selection\n" % userSelection)





More information about the tor-commits mailing list