def test_parse_element_exception(self): element = 'Movie (name,year,directors,actors,resume?,critique*' try: dtd_parser.parse_element(element) assert 0 except Exception as e: self.assertEqual(str(e), 'Unbalanced parenthesis %s' % element)
def test_parse_element_exception(self): element = 'Movie (name,year,directors,actors,resume?,critique*' try: dtd_parser.parse_element(element) assert 0 except Exception, e: self.assertEqual( str(e), 'Unbalanced parenthesis %s' % element)
def test_parse_element(self): element = 'Movie(name,year,directors,actors,resume?,critique*)' expected = ('Movie', 'name,year,directors,actors,resume?,critique*') self.assertEqual(dtd_parser.parse_element(element), expected) element = 'Movie ( name, year,directors,actors,resume?,critique*)' expected = ('Movie', 'name,year,directors,actors,resume?,critique*') self.assertEqual(dtd_parser.parse_element(element), expected)
def test_parse_element_exception_empty(self): try: dtd_parser.parse_element('') assert 0 except Exception as e: self.assertEqual(str(e), 'Error parsing element ')
def test_parse_element_exception_empty(self): try: dtd_parser.parse_element('') assert 0 except Exception, e: self.assertEqual(str(e), 'Error parsing element ')