def test_many_methods(self): self.assertEqual( configparser.parse_method_spec('* GET, HEAD:'), ['GET', 'HEAD'] )
def test_raises_SyntaxError_if_no_match(self): with self.assertRaises(SyntaxError) as assertion: configparser.parse_method_spec('foo;bar:') self.assertEqual( str(assertion.exception), 'expecting method spec')
def test_single_method(self): self.assertEqual( configparser.parse_method_spec('* GET:'), ['GET'] )