Esempio 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
Esempio 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
Esempio n. 3
0
def test_nbsp():
    func = e.css('#nbsp') | e.itertext() | list
    assert func(create_response(example)) == [u'\xa0\xa0']
Esempio 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
Esempio 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
Esempio n. 6
0
def test_nbsp():
    func = e.css('#nbsp') | e.itertext() | list
    assert func(create_response(example)) == [u'\xa0\xa0']