#NEWLINE# def test_ensure_namespace_existing( self ) : #NEWLINE# #INDENT# with mock . patch . object ( ip_lib , 'IpNetnsCommand' ) as ip_ns_cmd : #NEWLINE# #INDENT# ip_ns_cmd . exists . return_value = True #NEWLINE# ns = ip_lib . IPWrapper ( ) . ensure_namespace ( 'ns' ) #NEWLINE# self . assertFalse ( ip_ns_cmd . execute . called ) #NEWLINE# self . assertEqual ( ns . namespace , 'ns' )