def test_content_parser(self): parser = search.ContentParser() parser.feed('<h1 id="title">Title</h1>TEST') self.assertEquals( parser.data, [search.ContentSection(text=["TEST"], id_="title", title="Title")])
def test_content_parser_content_before_header(self): parser = search.ContentParser() parser.feed("Content Before H1 <h1>Title</h1>TEST") self.assertEquals( parser.data, [search.ContentSection(text=["TEST"], id_=None, title="Title")])
def test_content_parser_no_id(self): parser = search.ContentParser() parser.feed("<h1>Title</h1>TEST") parser.close() self.assertEquals( parser.data, [search.ContentSection(text=["TEST"], id_=None, title="Title")])