#NEWLINE# def test_get_node_networks_with_admin_net( self ) : #NEWLINE# #INDENT# node = self . env . nodes [ 0 ] #NEWLINE# default_admin_net = objects . NetworkGroup . get_default_admin_network ( ) #NEWLINE# with mock . patch . object ( objects . NetworkGroup , 'get_default_admin_network' ) as get_mock : #NEWLINE# #INDENT# get_mock . return_value = default_admin_net #NEWLINE# self . env . network_manager . get_node_networks ( node ) #NEWLINE# self . assertEqual ( get_mock . call_count , 1 ) #NEWLINE# #UNINDENT# with mock . patch . object ( objects . NetworkGroup , 'get_default_admin_network' ) as get_mock : #NEWLINE# #INDENT# self . env . network_manager . get_node_networks ( node , default_admin_net ) #NEWLINE# self . assertEqual ( get_mock . call_count , 0 )