[tor-commits] [stem/master] Fix variable name is close_circuit() test

atagar at torproject.org atagar at torproject.org
Sat Jan 5 03:23:28 UTC 2013


commit 9dbb7fc438192af25c93f08d43686563df18e8ac
Author: Sean Robinson <seankrobinson at gmail.com>
Date:   Sun Dec 30 15:08:51 2012 -0700

    Fix variable name is close_circuit() test
    
    This fixes a problem I created in commit 9119f9f0d0091a03.
    
    Signed-off-by: Sean Robinson <seankrobinson at gmail.com>
---
 test/integ/control/controller.py |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index 8fada2b..b212300 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -567,18 +567,20 @@ class TestController(unittest.TestCase):
     runner = test.runner.get_runner()
     
     with runner.get_tor_controller() as controller:
-      circ_id = controller.new_circuit()
-      controller.close_circuit(circ_id)
-      circuit_ids = [circ.id for circ in controller.get_circuits()]
-      self.assertFalse(circ_id in circuit_ids)
+      circuit_id = controller.new_circuit()
+      controller.close_circuit(circuit_id)
+      circuit_output = controller.get_info("circuit-status")
+      circ = [x.split()[0] for x in circuit_output.splitlines()]
+      self.assertFalse(circuit_id in circ)
       
-      circ_id = controller.new_circuit()
-      controller.close_circuit(circ_id, "IfUnused")
-      circuit_ids = [circ.id for circ in controller.get_circuits()]
-      self.assertFalse(circ_id in circuit_ids)
+      circuit_id = controller.new_circuit()
+      controller.close_circuit(circuit_id, "IfUnused")
+      circuit_output = controller.get_info("circuit-status")
+      circ = [x.split()[0] for x in circuit_output.splitlines()]
+      self.assertFalse(circuit_id in circ)
       
-      circ_id = controller.new_circuit()
-      self.assertRaises(stem.InvalidArguments, controller.close_circuit, str(int(circ_id) + 1024))
+      circuit_id = controller.new_circuit()
+      self.assertRaises(stem.InvalidArguments, controller.close_circuit, circuit_id + "1024")
       self.assertRaises(stem.InvalidRequest, controller.close_circuit, "")
   
   def test_get_streams(self):





More information about the tor-commits mailing list