def assert_extract(self, page, specs=None, compat=None, footnotes=None, issues=None): parsed = kumascript_grammar.parse(page) elements = self.visitor.visit(parsed) extractor = PageExtractor(elements=elements, feature=self.feature) extracted = extractor.extract() self.assertEqual(specs or [], extracted["specs"]) self.assertEqual(compat or [], extracted["compat"]) self.assertEqual(footnotes, extracted["footnotes"]) self.assertEqual(issues or [], extracted["issues"])
def assert_extract(self, page, specs=None, compat=None, footnotes=None, issues=None): parsed = kumascript_grammar.parse(page) elements = self.visitor.visit(parsed) extractor = PageExtractor(elements=elements, feature=self.feature) extracted = extractor.extract() self.assertEqual(specs or [], extracted['specs']) self.assertEqual(compat or [], extracted['compat']) self.assertEqual(footnotes, extracted['footnotes']) self.assertEqual(issues or [], extracted['issues'])
def assert_specdesc(self, html, items, issues): parsed = kumascript_grammar.parse(html) self.visitor.visit(parsed) actual = [item.to_html() for item in self.visitor.desc_items] self.assertEqual(items, actual) self.assertEqual(self.visitor.issues, issues)
def assert_spec2(self, html, mdn_key, issues): parsed = kumascript_grammar.parse(html) out = self.visitor.visit(parsed) self.assertTrue(out) self.assertEqual(self.visitor.mdn_key, mdn_key) self.assertEqual(self.visitor.issues, issues)