[Pkg-privacy-commits] [txtorcon] 58/96: test iterator protocol of TorConfig

Jérémy Bobbio lunar at moszumanska.debian.org
Sun Sep 6 18:33:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository txtorcon.

commit 7ebc6301f4aee28ba0d2e477ee24feffacd459af
Author: meejah <meejah at meejah.ca>
Date:   Thu Feb 5 18:31:36 2015 -0700

    test iterator protocol of TorConfig
---
 test/test_torconfig.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/test/test_torconfig.py b/test/test_torconfig.py
index 46e8b94..a431a1e 100644
--- a/test/test_torconfig.py
+++ b/test/test_torconfig.py
@@ -1434,6 +1434,18 @@ ControlPort Port''')
         return pp
 
 
+class IteratorTests(unittest.TestCase):
+    def test_iterate_torconfig(self):
+        cfg = TorConfig()
+        cfg.FooBar = 'quux'
+        cfg.save()
+        cfg.Quux = 'blimblam'
+
+        keys = sorted([k for k in cfg])
+
+        self.assertEqual(['FooBar', 'Quux'], keys)
+
+
 class ErrorTests(unittest.TestCase):
     @patch('txtorcon.torconfig.find_tor_binary')
     def test_no_tor_binary(self, ftb):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/txtorcon.git



More information about the Pkg-privacy-commits mailing list