def test_attrib_default(): f = e.css('#div1 a') | e.attrib('nosuch', '') | list assert f(create_response(example)) == ['', '', '']
def test_attrib(): f = e.css('#div1 a') | e.attrib('href') | list r = create_response(example) assert f(r) == ['/1', ' /2 ', None]