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

[tor-commits] [stem/master] Make test_close_circuit use Controller.get_circuits()



commit bcd03831cace7352a7cbdf4e9f4dd651d86a48af
Author: Ravi Chandra Padmala <neenaoffline@xxxxxxxxx>
Date:   Sat Dec 22 17:25:19 2012 +0530

    Make test_close_circuit use Controller.get_circuits()
---
 test/integ/control/controller.py |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index 1b2c146..ef9d503 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -565,17 +565,15 @@ class TestController(unittest.TestCase):
     runner = test.runner.get_runner()
     
     with runner.get_tor_controller() as controller:
-      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(circ_id in circ)
+      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, "IfUnused")
-      circuit_output = controller.get_info("circuit-status")
-      circ = [x.split()[0] for x in circuit_output.splitlines()]
-      self.assertFalse(circ_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()
       self.assertRaises(stem.InvalidArguments, controller.close_circuit, circuit_id + "1024")



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