#NEWLINE# def test_delete_bridge_not_exist( self ) : #NEWLINE# #INDENT# self . lbm . interface_mappings . update ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# bridge_device = mock . Mock ( ) #NEWLINE# with mock . patch . object ( bridge_lib , 'BridgeDevice' , return_value = bridge_device ) : #NEWLINE# #INDENT# bridge_device . exists . side_effect = [ True , False ] #NEWLINE# bridge_device . get_interfaces . return_value = [ ] #NEWLINE# bridge_device . link . set_down . side_effect = RuntimeError #NEWLINE# self . lbm . delete_bridge ( 'br0' ) #NEWLINE# self . assertEqual ( 2 , bridge_device . exists . call_count ) #NEWLINE# bridge_device . exists . side_effect = [ True , True ] #NEWLINE# self . assertRaises ( RuntimeError , self . lbm . delete_bridge , 'br0' )