#NEWLINE# def test_ensure_physical_in_bridge( self ) : #NEWLINE# #INDENT# self . assertFalse ( self . lbm . ensure_physical_in_bridge ( '123' , p_const . TYPE_VLAN , 'phys' , '1' ) ) #NEWLINE# with mock . patch . object ( self . lbm , 'ensure_flat_bridge' ) as flbr_fn : #NEWLINE# #INDENT# self . assertTrue ( self . lbm . ensure_physical_in_bridge ( '123' , p_const . TYPE_FLAT , 'physnet1' , None ) ) #NEWLINE# self . assertTrue ( flbr_fn . called ) #NEWLINE# #UNINDENT# with mock . patch . object ( self . lbm , 'ensure_vlan_bridge' ) as vlbr_fn : #NEWLINE# #INDENT# self . assertTrue ( self . lbm . ensure_physical_in_bridge ( '123' , p_const . TYPE_VLAN , 'physnet1' , '1' ) ) #NEWLINE# self . assertTrue ( vlbr_fn . called ) #NEWLINE# #UNINDENT# with mock . patch . object ( self . lbm , 'ensure_vxlan_bridge' ) as vlbr_fn : #NEWLINE# #INDENT# self . lbm . vxlan_mode = lconst . VXLAN_MCAST #NEWLINE# self . assertTrue ( self . lbm . ensure_physical_in_bridge ( '123' , p_const . TYPE_VXLAN , 'physnet1' , '1' ) ) #NEWLINE# self . assertTrue ( vlbr_fn . called )