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