[Inteproxy-commits] r299 - in trunk: . test

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 17 22:14:05 CET 2011


Author: bh
Date: 2011-02-17 22:14:05 +0100 (Thu, 17 Feb 2011)
New Revision: 299

Modified:
   trunk/ChangeLog
   trunk/test/test_config.py
Log:
* test/test_config.py (TestReadConfigHttpProxySpecialChars): New
test case for usernames and passwords with special characters like
backslashes and percent signs.


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-11-18 09:03:55 UTC (rev 298)
+++ trunk/ChangeLog	2011-02-17 21:14:05 UTC (rev 299)
@@ -1,3 +1,9 @@
+2011-02-17  Bernhard Herzog  <bh at intevation.de>
+
+	* test/test_config.py (TestReadConfigHttpProxySpecialChars): New
+	test case for usernames and passwords with special characters like
+	backslashes and percent signs.
+
 2010-11-18  Ingo Weinzierl <ingo at intevation.de>
 
 	* create-rewrite-rules.py: Changed the regular expression that is used

Modified: trunk/test/test_config.py
===================================================================
--- trunk/test/test_config.py	2010-11-18 09:03:55 UTC (rev 298)
+++ trunk/test/test_config.py	2011-02-17 21:14:05 UTC (rev 299)
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2009 by Intevation GmbH
+# Copyright (C) 2008, 2009, 2011 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh at intevation.de>
 #
@@ -66,6 +66,26 @@
                               username=None, password=None)
 
 
+class TestReadConfigHttpProxySpecialChars(ReadConfigTest):
+
+    config_contents = """\
+[inteproxy]
+http_proxy=special_proxy
+
+[special_proxy]
+host=example.com
+username=foo\\b\ta\040r
+password=special%%\()
+"""
+
+    def test_readconfig(self):
+        config = read_config(self.config_file)
+        self.check_attributes(config, https_proxy=None)
+        self.check_attributes(config.http_proxy,
+                              host="example.com", port=80,
+                              username="foo\\b\ta r", password="special%\\()")
+
+
 class TestReadConfigHttpsProxyWithPortAndAuth(ReadConfigTest):
 
     config_contents = """\



More information about the Inteproxy-commits mailing list