#NEWLINE# def _test_capability( self , capability , subcapability = None , expected = True , stdout = '' , stderr = '' ) : #NEWLINE# #INDENT# with mock . patch ( 'neutron.agent.linux.utils.execute' ) as mock_exec : #NEWLINE# #INDENT# mock_exec . return_value = ( stdout , capable ) #NEWLINE# vf_section = ip_link . IpLinkSupport . get_vf_mgmt_section ( ) #NEWLINE# capable = ip_link . IpLinkSupport . vf_mgmt_capability_supported ( vf_section , capability , subcapability ) #NEWLINE# self . assertEqual ( expected , capable ) #NEWLINE# mock_exec . assert_called_once_with ( [ 'ip' , 'link' , 'help' ] , check_exit_code = False , return_stderr = True , log_fail_as_error = False )