@@ -1240,23 +1240,25 @@ def test_live_deploy_with_different_brokerage_and_different_live_data_provider_a
12401240 api_client = mock .MagicMock ()
12411241 create_lean_option (brokerage_name , data_provider_live_name , data_provider_historical_name , api_client )
12421242
1243+ # Filter method calls to include only 'modules.list_files' calls
1244+ filtered_calls = [call for call in api_client .method_calls if call [0 ] == 'modules.list_files' ]
12431245 is_exists = []
12441246 if brokerage_product_id is None and data_provider_historical_name != "Local" :
1245- assert len (api_client .method_calls ) == 2
1246- for m_c , id in zip (api_client . method_calls , [data_provider_live_product_id , data_provider_historical_id ]):
1247+ assert len (api_client .method_calls ) == 3
1248+ for m_c , id in zip (filtered_calls , [data_provider_live_product_id , data_provider_historical_id ]):
12471249 if id in m_c [1 ]:
12481250 is_exists .append (True )
12491251 assert is_exists
12501252 assert len (is_exists ) == 1
12511253 elif brokerage_product_id is None and data_provider_historical_name == "Local" :
1252- assert len (api_client .method_calls ) == 1
1253- if int (data_provider_live_product_id ) in api_client . method_calls [0 ][1 ]:
1254+ assert len (api_client .method_calls ) == 2
1255+ if int (data_provider_live_product_id ) in filtered_calls [0 ][1 ]:
12541256 is_exists .append (True )
12551257 assert is_exists
12561258 assert len (is_exists ) == 1
12571259 else :
1258- assert len (api_client .method_calls ) == 3
1259- for m_c , id in zip (api_client . method_calls , [data_provider_live_product_id , data_provider_historical_id , brokerage_product_id ]):
1260+ assert len (api_client .method_calls ) == 4
1261+ for m_c , id in zip (filtered_calls , [data_provider_live_product_id , data_provider_historical_id , brokerage_product_id ]):
12601262 if id in f"{ m_c [1 ]} " :
12611263 is_exists .append (True )
12621264 assert is_exists
@@ -1272,12 +1274,14 @@ def test_live_non_interactive_deploy_with_different_brokerage_and_different_live
12721274 api_client = mock .MagicMock ()
12731275 create_lean_option (brokerage_name , data_provider_live_name , None , api_client )
12741276
1275- assert len (api_client .method_calls ) == 2
1277+ assert len (api_client .method_calls ) == 3
1278+
1279+ # Filter method calls to include only 'modules.list_files' calls
1280+ filtered_calls = [call for call in api_client .method_calls if call [0 ] == 'modules.list_files' ]
12761281 is_exists = []
1277- for m_c , id in zip (api_client . method_calls , [data_provider_live_product_id , brokerage_product_id ]):
1282+ for m_c , id in zip (filtered_calls , [data_provider_live_product_id , brokerage_product_id ]):
12781283 if id in m_c [1 ]:
12791284 is_exists .append (True )
1280-
12811285 assert is_exists
12821286 assert len (is_exists ) == 2
12831287
@@ -1309,7 +1313,7 @@ def test_live_non_interactive_deploy_paper_brokerage_different_live_data_provide
13091313 api_client = mock .MagicMock ()
13101314 create_lean_option (brokerage_name , data_provider_live_name , None , api_client )
13111315
1312- assert len (api_client .method_calls ) == 1
1316+ assert len (api_client .method_calls ) == 2
13131317 for m_c in api_client .method_calls :
13141318 if data_provider_live_product_id in str (m_c [1 ]):
13151319 is_exist = True
0 commit comments