コード例 #1
0
ファイル: test_extractor.py プロジェクト: eBay/wextracto
def test_label_named():
    # bug test
    labeller  = (lambda x: x)
    n = named(a1=(lambda x: 'bar'))
    extract = label(labeller)(n)
    assert list(extract("foo")) == [("foo", "a1", "bar")]
コード例 #2
0
ファイル: test_extractor.py プロジェクト: eBay/wextracto
def test_label():
    labeller  = (lambda x: x)
    extract = label(labeller)(extract_arg0)
    assert list(extract("foo")) == [("foo", "foo")]
コード例 #3
0
def test_label_named():
    # bug test
    labeller = (lambda x: x)
    n = named(a1=(lambda x: 'bar'))
    extract = label(labeller)(n)
    assert list(extract("foo")) == [("foo", "a1", "bar")]
コード例 #4
0
ファイル: tutorial.py プロジェクト: ortodesign/wextracto
from wex.extractor import label, named
from wex.url import url
from wex.etree import xpath, text

attrs = named(name=xpath('//h1') | text,
              country=xpath('//dd[@id="country"]') | text,
              region=xpath('//dd[@id="region"]') | text)

extract = label(url)(attrs)
コード例 #5
0
def test_label():
    labeller = (lambda x: x)
    extract = label(labeller)(extract_arg0)
    assert list(extract("foo")) == [("foo", "foo")]