[tor-commits] [stem/master] Add getconf test to check for multiline configuration keys
atagar at torproject.org
atagar at torproject.org
Wed Jul 4 21:34:20 UTC 2012
commit f6231a9dd9ed52dae4e77e153cae13e344a4e094
Author: Ravi Chandra Padmala <neenaoffline at gmail.com>
Date: Sun Jun 17 20:29:58 2012 +0530
Add getconf test to check for multiline configuration keys
---
test/integ/control/controller.py | 6 ++++++
test/runner.py | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/test/integ/control/controller.py b/test/integ/control/controller.py
index db7941c..9d1028b 100644
--- a/test/integ/control/controller.py
+++ b/test/integ/control/controller.py
@@ -171,6 +171,12 @@ class TestController(unittest.TestCase):
self.assertRaises(stem.socket.InvalidRequest, controller.get_conf, "blarg")
self.assertEqual("la-di-dah", controller.get_conf("blarg", "la-di-dah"))
+ # multivalue configuration keys
+
+ nodefamilies = [node_family[11:].strip() for node_family in
+ runner.get_torrc_contents().split("\n") if node_family.startswith("NodeFamily ")]
+ self.assertEqual(nodefamilies, controller.get_conf("NodeFamily", multiple = True))
+
# empty input
self.assertRaises(stem.socket.InvalidRequest, controller.get_conf, "")
diff --git a/test/runner.py b/test/runner.py
index 3b696b3..571bb9d 100644
--- a/test/runner.py
+++ b/test/runner.py
@@ -71,6 +71,8 @@ BASE_TORRC = """# configuration for stem integration tests
DataDirectory %s
SocksPort 0
DownloadExtraInfo 1
+NodeFamily dummystemnodexyz1x1,dummystemnodexyz1x2,dummystemnodexyz1x3
+NodeFamily dummystemnodexyz2x1,dummystemnodexyz2x2,dummystemnodexyz2x3
"""
# We make some paths relative to stem's base directory (the one above us)
More information about the tor-commits
mailing list