#NEWLINE# def test_load_marathon_service_config_happy_path( self ) : #NEWLINE# #INDENT# fake_name = 'jazz' #NEWLINE# fake_instance = 'solo' #NEWLINE# fake_cluster = 'amnesia' #NEWLINE# fake_dir = '/nail/home/sanfran' #NEWLINE# with contextlib . nested ( mock . patch ( 'paasta_tools.marathon_tools.load_deployments_json' , autospec = True ) , mock . patch ( 'service_configuration_lib.read_service_configuration' , autospec = True ) , mock . patch ( 'service_configuration_lib.read_extra_service_information' , autospec = True ) , mock . patch ( 'paasta_tools.marathon_tools.deep_merge_dictionaries' , autospec = True ) ) as ( mock_load_deployments_json , mock_read_service_configuration , mock_read_extra_service_information , _ ) : #NEWLINE# #INDENT# mock_read_extra_service_information . return_value = { #NEWLINE# #INDENT# fake_instance : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# marathon_tools . load_marathon_service_config ( fake_name , fake_instance , mock_load_deployments_json , soa_dir = fake_dir ) #NEWLINE# assert ( mock_read_service_configuration . call_count == 1 ) #NEWLINE# assert ( mock_read_extra_service_information . call_count == 1 ) #NEWLINE# mock_load_deployments_json . assert_called_once_with ( fake_name , soa_dir = fake_dir )