commit 848d4c95b5c6f908755ac7db4019a3ac2bf2e9eb Author: Sean Robinson seankrobinson@gmail.com Date: Sun Dec 16 19:46:41 2012 -0700
Fix test_repurpose_circuit crash by changing directive in format string
Traceback: File "./test/integ/control/controller.py", line 486, in test_repurpose_circuit circ = filter(re.compile("^%i " % circ_id).match, circuit_output.splitlines())[0] TypeError: %d format: a number is required, not str
Also, change to standard variable name "circuit_id.
Signed-off-by: Sean Robinson seankrobinson@gmail.com --- test/integ/control/controller.py | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py index 969836b..8c68ee2 100644 --- a/test/integ/control/controller.py +++ b/test/integ/control/controller.py @@ -527,15 +527,15 @@ class TestController(unittest.TestCase): runner = test.runner.get_runner()
with runner.get_tor_controller() as controller: - circ_id = controller.new_circuit() - controller.repurpose_circuit(circ_id, "CONTROLLER") + circuit_id = controller.new_circuit() + controller.repurpose_circuit(circuit_id, "CONTROLLER") circuit_output = controller.get_info("circuit-status") - circ = filter(re.compile("^%i " % circ_id).match, circuit_output.splitlines())[0] + circ = filter(re.compile("^%s " % circuit_id).match, circuit_output.splitlines())[0] self.assertTrue("PURPOSE=CONTROLLER" in circ)
- controller.repurpose_circuit(circ_id, "GENERAL") + controller.repurpose_circuit(circuit_id, "GENERAL") circuit_output = controller.get_info("circuit-status") - circ = filter(re.compile("^%i " % circ_id).match, circuit_output.splitlines())[0] + circ = filter(re.compile("^%s " % circuit_id).match, circuit_output.splitlines())[0] self.assertTrue("PURPOSE=GENERAL" in circ)
self.assertRaises(stem.InvalidRequest, controller.repurpose_circuit, 'f934h9f3h4', "fooo")
tor-commits@lists.torproject.org