Пример #1
0
 def test_raises_SyntaxError_if_no_match(self):
     with self.assertRaises(SyntaxError) as assertion:
         configparser.parse_handler_spec('42')
     self.assertEqual(
         str(assertion.exception), 'expecting handler spec')
Пример #2
0
 def test_handler_with_name(self):
     handler, name = configparser.parse_handler_spec('foo.bar (baz)')
     self.assertEqual(handler, 'foo.bar')
     self.assertEqual(name, 'baz')
Пример #3
0
 def test_with_trailing_colon(self):
     handler, name = configparser.parse_handler_spec('foo.bar:')
     self.assertEqual(handler, 'foo.bar')
     self.assertIs(name, None)
Пример #4
0
 def test_just_a_handler(self):
     handler, name = configparser.parse_handler_spec('foo.bar')
     self.assertEqual(handler, 'foo.bar')
     self.assertIs(name, None)