def test_rank(etree): k = measure(etree.xpath('//body//*/..')) rv = rank(k) assert list(rv)[0] == (etree.xpath('//article')[0], StatsCounter(['div'] * 9))
def test_rank(etree): k = measure(etree.xpath('//body//*/..')) rv = rank(k) assert list(rv)[0] == (etree.xpath('//article')[0], StatsCounter(['div']*9))
def test_measure(etree): rv = measure(etree.xpath('//div/..')) uv = [(node.tag, metric) for node, metric in rv] assert uv == [('article', StatsCounter(['div'] * 9))]
def test_measure(etree): rv = measure(etree.xpath('//div/..')) uv = [(node.tag, metric) for node, metric in rv] assert uv == [('article', StatsCounter(['div']*9))]