예제 #1
0
def test_rank(etree):
    k = measure(etree.xpath('//body//*/..'))
    rv = rank(k)

    assert list(rv)[0] == (etree.xpath('//article')[0],
                           StatsCounter(['div'] * 9))
예제 #2
0
def test_rank(etree):
    k = measure(etree.xpath('//body//*/..'))
    rv = rank(k)

    assert list(rv)[0] ==  (etree.xpath('//article')[0],
                            StatsCounter(['div']*9))
예제 #3
0
def test_measure(etree):
    rv = measure(etree.xpath('//div/..'))
    uv = [(node.tag, metric) for node, metric in rv]

    assert uv == [('article', StatsCounter(['div'] * 9))]
예제 #4
0
def test_measure(etree):
    rv = measure(etree.xpath('//div/..'))
    uv = [(node.tag, metric) for node, metric in rv]

    assert uv == [('article', StatsCounter(['div']*9))]