示例#1
0
def test_itertext_elem():
    f = e.css('.thing') | first | e.itertext() | list
    expected = ['First ', 'one thing']
    assert f(create_response(example)) == expected
示例#2
0
def test_itertext():
    f = e.css('.thing') | e.itertext() | flatten | list
    expected = ['First ', 'one thing', 'then ', 'another thing', '.']
    assert f(create_response(example)) == expected
示例#3
0
def test_nbsp():
    func = e.css('#nbsp') | e.itertext() | list
    assert func(create_response(example)) == [u'\xa0\xa0']
示例#4
0
def test_itertext_elem():
    f = e.css('.thing') | first | e.itertext() | list
    expected = ['First ', 'one thing']
    assert f(create_response(example)) == expected
示例#5
0
def test_itertext():
    f = e.css('.thing') | e.itertext() | flatten | list
    expected = ['First ', 'one thing', 'then ', 'another thing', '.']
    assert f(create_response(example)) == expected
示例#6
0
def test_nbsp():
    func = e.css('#nbsp') | e.itertext() | list
    assert func(create_response(example)) == [u'\xa0\xa0']