Explorar el Código

Add test and changelog entry for dict_of_key_value_pairs fix

Mike Naberezny hace 13 años
padre
commit
dfabd36aca
Se han modificado 2 ficheros con 8 adiciones y 0 borrados
  1. 3 0
      CHANGES.txt
  2. 5 0
      supervisor/tests/test_datatypes.py

+ 3 - 0
CHANGES.txt

@@ -1,6 +1,9 @@
 Next release
 ------------
 
+- Fixed a bug where parsing ``environment=`` did not verify that key/value
+  pairs were correctly separated.  Patch by Martijn Pieters.
+
 - Fixed a bug in the HTTP server code that could cause unnecessary delays
   when sending large responses.  Patch by Philip Zeyliger.
 

+ 5 - 0
supervisor/tests/test_datatypes.py

@@ -138,6 +138,11 @@ class DatatypesTest(unittest.TestCase):
         self.assertRaises(ValueError,
                           datatypes.dict_of_key_value_pairs, 'foo=bar,baz=')
 
+    def test_dict_of_key_value_pairs_raises_when_comma_is_missing(self):
+        kvp = 'KEY1=no-comma KEY2=ends-with-comma,'
+        self.assertRaises(ValueError,
+                          datatypes.dict_of_key_value_pairs, kvp)
+
     def test_logfile_name_returns_none_for_none_values(self):
         for thing in datatypes.LOGFILE_NONES:
             actual = datatypes.logfile_name(thing)