Exemplo n.º 1
0
def test_add_landmark_empty_title():
	"""Verify we can find a landmark title when title element is empty"""
	soup = BeautifulSoup('<html><head><title></title><body><section epub:type="foo"><h1></h1></section></body></html>', features="lxml")
	landmarks = []
	add_landmark(soup, "file", landmarks)

	assert landmarks[0].title == "Foo"
Exemplo n.º 2
0
def test_add_landmark_empty_title():
    """Verify we can find a landmark title when title element is empty"""
    dom = se.easy_xml.EasyXmlTree(
        '<?xml version="1.0" encoding="utf-8"?>\n<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="z3998: http://www.daisy.org/z3998/2012/vocab/structure/, se: https://standardebooks.org/vocab/1.0" xml:lang="en-US"><head><title></title></head><body><section epub:type="foo"><h1></h1></section></body></html>'
    )
    landmarks = []
    add_landmark(dom, "file", landmarks)

    assert landmarks[0].title == "Foo"