#NEWLINE# def test_get_proxy_port_for_instance_defaults_to_none( self ) : #NEWLINE# #INDENT# name = 'thats_no_moon' #NEWLINE# instance = 'thats_a_space_station' #NEWLINE# cluster = 'shot_line' #NEWLINE# soa_dir = 'drink_up' #NEWLINE# namespace = 'thirsty_mock' #NEWLINE# expected = None #NEWLINE# with contextlib . nested ( mock . patch ( 'paasta_tools.marathon_tools.read_namespace_for_service_instance' , autospec = True , return_value = namespace ) , mock . patch ( 'paasta_tools.marathon_tools.load_service_namespace_config' , autospec = True , return_value = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) as ( read_ns_patch , read_config_patch ) : #NEWLINE# #INDENT# actual = marathon_tools . get_proxy_port_for_instance ( name , instance , cluster , soa_dir ) #NEWLINE# assert ( expected == actual ) #NEWLINE# read_ns_patch . assert_called_once_with ( name , instance , cluster , soa_dir ) #NEWLINE# read_config_patch . assert_called_once_with ( name , namespace , soa_dir )