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

[tor-commits] [stem/master] Skipping repurpose_circuit() test if offline



commit d97a0c30002062ac0fbc45b32c2be6061cc35594
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Aug 27 11:08:10 2012 -0700

    Skipping repurpose_circuit() test if offline
    
    The repurpose_circuit() test uses 'GETINFO circuit-status' results which are
    empty when offline, causing an error...
    
    ======================================================================
    ERROR: test_repurpose_circuit
    ----------------------------------------------------------------------
    Traceback:
      File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 386, in test_repurpose_circuit
        first_circ = controller.get_info('circuit-status').splitlines()[0].split()
    IndexError: list index out of range
    
    ----------------------------------------------------------------------
    Ran 14 tests in 1.390s
---
 test/integ/control/controller.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index 5a078c0..5f5113c 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -383,7 +383,13 @@ class TestController(unittest.TestCase):
     runner = test.runner.get_runner()
     
     with runner.get_tor_controller() as controller:
-      first_circ = controller.get_info('circuit-status').splitlines()[0].split()
+      circuit_output = controller.get_info('circuit-status')
+      
+      # the circuit-status results will be empty if we don't have a connection
+      if circuit_output == '':
+        if test.runner.require_online(self): return
+      
+      first_circ = circuit_output.splitlines()[0].split()
       circ_id = int(first_circ[0])
       purpose = "CONTROLLER"
       if "PURPOSE=CONTROLLER" in first_circ:



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