Exemplo n.º 1
0
 def test_raises_SyntaxError_if_no_match(self):
     with self.assertRaises(SyntaxError) as assertion:
         configparser.parse_exception_handler_spec(': handler')
     self.assertEqual(
         str(assertion.exception),
         'expecting exception handler spec'
     )
Exemplo n.º 2
0
 def test_many_types(self):
     types, handler = configparser.parse_exception_handler_spec(
         'exc1, exc2: handler')
     self.assertEqual(types, ('exc1', 'exc2'))
     self.assertEqual(handler, 'handler')
Exemplo n.º 3
0
 def test_single_type(self):
     types, handler = configparser.parse_exception_handler_spec(
         'exc: handler')
     self.assertEqual(types, ('exc',))
     self.assertEqual(handler, 'handler')