Exemplo n.º 1
0
def test_itertext_elem():
    f = e.css('.thing') | first | e.itertext() | list
    expected = ['First ', 'one thing']
    assert f(create_response(example)) == expected
Exemplo n.º 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
Exemplo n.º 3
0
def test_nbsp():
    func = e.css('#nbsp') | e.itertext() | list
    assert func(create_response(example)) == [u'\xa0\xa0']
Exemplo n.º 4
0
def test_itertext_elem():
    f = e.css('.thing') | first | e.itertext() | list
    expected = ['First ', 'one thing']
    assert f(create_response(example)) == expected
Exemplo n.º 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
Exemplo n.º 6
0
def test_nbsp():
    func = e.css('#nbsp') | e.itertext() | list
    assert func(create_response(example)) == [u'\xa0\xa0']