Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
    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)
Exemple #4
0
    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)
Exemple #5
0
 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 ')
Exemple #6
0
 def test_parse_element_exception_empty(self):
     try:
         dtd_parser.parse_element('')
         assert 0
     except Exception, e:
         self.assertEqual(str(e), 'Error parsing element ')