#NEWLINE# def test_ensure_vlan_bridge( self ) : #NEWLINE# #INDENT# with mock . patch . object ( get_int_det_fn . lbm , 'ensure_vlan' ) as ens_vl_fn , mock . patch . object ( self . lbm , 'ensure_bridge' ) as ens , mock . patch . object ( self . lbm , 'get_interface_details' ) as get_int_det_fn : #NEWLINE# #INDENT# ens_vl_fn . return_value = 'eth0.1' #NEWLINE# get_int_det_fn . return_value = ( None , None ) #NEWLINE# self . assertEqual ( 'eth0.1' , self . lbm . ensure_vlan_bridge ( '123' , None , 'eth0' , '1' ) ) #NEWLINE# ens . assert_called_with ( 'brq123' , 'eth0.1' , None , None ) #NEWLINE# get_int_det_fn . return_value = ( 'ips' , 'gateway' ) #NEWLINE# self . assertEqual ( 'eth0.1' , self . lbm . ensure_vlan_bridge ( '123' , None , 'eth0' , '1' ) ) #NEWLINE# ens . assert_called_with ( 'brq123' , 'eth0.1' , 'ips' , 'gateway' )