コード例 #1
0
ファイル: test_configparser.py プロジェクト: dhain/potpy
 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'
     )
コード例 #2
0
ファイル: test_configparser.py プロジェクト: dhain/potpy
 def test_many_types(self):
     types, handler = configparser.parse_exception_handler_spec(
         'exc1, exc2: handler')
     self.assertEqual(types, ('exc1', 'exc2'))
     self.assertEqual(handler, 'handler')
コード例 #3
0
ファイル: test_configparser.py プロジェクト: dhain/potpy
 def test_single_type(self):
     types, handler = configparser.parse_exception_handler_spec(
         'exc: handler')
     self.assertEqual(types, ('exc',))
     self.assertEqual(handler, 'handler')