def runTest(self): p = YadisHTMLParser() try: p.feed(self.case) except ParseDone, why: found = why[0] # make sure we protect outselves against accidental bogus # test cases assert found not in self.reserved_values # convert to a string if found is None: found = 'None' msg = "%r != %r for case %s" % (found, self.expected, self.case) self.failUnlessEqual(found, self.expected, msg)
def runTest(self): p = YadisHTMLParser() try: p.feed(self.case) except ParseDone as why: found = why.args[0] # make sure we protect outselves against accidental bogus # test cases assert found not in self.reserved_values # convert to a string if found is None: found = 'None' msg = "%r != %r for case %s" % (found, self.expected, self.case) self.assertEqual(found, self.expected, msg) else: self.assertTrue(self.expected == 'EOF', (self.case, self.expected))
def test(self): for expected, case in getCases(): p = YadisHTMLParser() try: p.feed(case) except ParseDone as why: found = why[0] # make sure we protect outselves against accidental bogus # test cases assert found not in self.reserved_values # convert to a string if found is None: found = 'None' msg = "%r != %r for case %s" % (found, expected, case) self.assertEqual(found, expected, msg) except HTMLParseError: self.assertEqual(expected, 'None', (case, expected)) else: self.assertEqual(expected, 'EOF', (case, expected))