Ejemplo n.º 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')
Ejemplo n.º 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')
Ejemplo n.º 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)
Ejemplo n.º 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)