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