def _find_matching_button(category, component_type):
 buttons = world.css_find('div.new-component-{} button'.format(category))
 matched_buttons = [btn for btn in buttons if (btn.text == component_type)]
 assert_equal(len(matched_buttons), 1)
 return matched_buttons[0]

def _find_matching_button ( category , component_type ) : buttons = world . css_find ( 'div.new-component-{} button' . format ( category ) ) matched_buttons = [ btn for btn in buttons if ( btn . text == component_type ) ] assert_equal ( len ( matched_buttons ) , 1 ) return matched_buttons [ 0 ]
find the button with the specified text .