Browse Source

Add test for missing [supervisorctl] section

Mike Naberezny 10 years ago
parent
commit
7d021503ff
1 changed files with 11 additions and 2 deletions
  1. 11 2
      supervisor/tests/test_options.py

+ 11 - 2
supervisor/tests/test_options.py

@@ -365,6 +365,15 @@ class ClientOptionsTests(unittest.TestCase):
         else:
             self.fail("expected exception")
 
+    def test_read_config_no_supervisord_section_raises_valueerror(self):
+        instance = self._makeOne()
+        try:
+            instance.read_config(StringIO())
+            self.fail("nothing raised")
+        except ValueError, exc:
+            self.assertEqual(exc.args[0],
+                ".ini file does not include supervisorctl section")
+
     def test_options_unixsocket_cli(self):
         fp = StringIO('[supervisorctl]')
         instance = self._makeOne()
@@ -2549,7 +2558,7 @@ class ServerOptionsTests(unittest.TestCase):
                                  'supervisor.rpcinterface_factory',
                                  'rpcinterface:')
             self.fail('nothing raised')
-        except ValueError as exc:
+        except ValueError, exc:
             self.assertEqual(exc.args[0], 'section [rpcinterface:dummy] '
                 'does not specify a supervisor.rpcinterface_factory')
 
@@ -2567,7 +2576,7 @@ class ServerOptionsTests(unittest.TestCase):
                                  'supervisor.rpcinterface_factory',
                                  'rpcinterface:')
             self.fail('nothing raised')
-        except ValueError as exc:
+        except ValueError, exc:
             self.assertEqual(exc.args[0], 'nonexistant cannot be resolved '
                 'within [rpcinterface:dummy]')