#NEWLINE# def test_selected_attribute( ) : #NEWLINE# #INDENT# node = xpath . XPathNode ( element = 'element' , selected_attribute = 'value' ) #NEWLINE# assert ( node . xpath == '//element/@value' ) #NEWLINE# tree = etree . XML ( "<top><container><element value='1'></element><element value='2'></element></container></top>" ) #NEWLINE# builder = xpath . xpb . container . element . select_attribute_ ( 'value' ) #NEWLINE# assert ( builder . xpath == './/container//element/@value' ) #NEWLINE# assert ( builder . apply_ ( tree ) == [ '1' , '2' ] ) #NEWLINE# assert ( xpath . xpb . element . select_attribute_ ( 'value' , elem = tree ) == [ '1' , '2' ] )