Skip to content

Commit

Permalink
rename: data-provider in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Feb 7, 2024
1 parent 42d3754 commit e60cd97
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lean/commands/cloud/live/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def deploy(project: str,
logger.info(f"Environment: {brokerage_settings['environment'].title()}")
logger.info(f"Server name: {live_node.name}")
logger.info(f"Server type: {live_node.sku}")
logger.info(f"Data provider historical: {price_data_handler.replace('Handler', '')}")
logger.info(f"Data provider live: {price_data_handler.replace('Handler', '')}")
logger.info(f"LEAN version: {cloud_project.leanVersionId}")
logger.info(f"Order event notifications: {'Yes' if notify_order_events else 'No'}")
logger.info(f"Insight notifications: {'Yes' if notify_insights else 'No'}")
Expand Down
4 changes: 2 additions & 2 deletions tests/commands/cloud/live/test_cloud_live_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_cloud_live_deploy_with_ib_using_hybrid_datafeed() -> None:
"--ib-account", "DU2366417", "--ib-password", "test_password"])

assert result.exit_code == 0
assert "Data provider: quantconnecthandler+interactivebrokershandler" in result.output.split("\n")
assert "Data provider live: quantconnecthandler+interactivebrokershandler" in result.output.split("\n")

def test_cloud_live_deploy_with_tradier_using_tradier_datafeed() -> None:
create_fake_lean_cli_directory()
Expand All @@ -135,7 +135,7 @@ def test_cloud_live_deploy_with_tradier_using_tradier_datafeed() -> None:
"--tradier-access-token", "456", "--tradier-environment", "paper"])

assert result.exit_code == 0
assert "Data provider: TradierBrokerage" in result.output.split("\n")
assert "Data provider live: TradierBrokerage" in result.output.split("\n")

@pytest.mark.parametrize("notice_method,configs", [("emails", "customAddress:customSubject"),
("emails", "customAddress1:customSubject1,customAddress2:customSubject2"),
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/test_backtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def test_backtest_passes_data_purchase_limit_to_lean_runner() -> None:
}
""")

result = CliRunner().invoke(lean, ["backtest", "Python Project", "--data-provider", "QuantConnect", "--data-purchase-limit", "1000"])
result = CliRunner().invoke(lean, ["backtest", "Python Project", "--data-provider-historical", "QuantConnect", "--data-purchase-limit", "1000"])

assert result.exit_code == 0

Expand Down
26 changes: 13 additions & 13 deletions tests/commands/test_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def test_live_calls_lean_runner_with_data_provider(data_provider: str) -> None:
options.extend([f"--{key}", value])

result = CliRunner().invoke(lean, ["live", "CSharp Project", "--environment", "live-paper",
"--data-provider", data_provider,
"--data-provider-historical", data_provider,
*options])

expected = 0
Expand Down Expand Up @@ -488,7 +488,7 @@ def test_live_non_interactive_aborts_when_missing_brokerage_options(brokerage: s

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", brokerage,
"--data-feed", data_feed,
"---data-provider-live", data_feed,
*options])
assert result.exit_code != 0

Expand All @@ -511,7 +511,7 @@ def test_live_non_interactive_aborts_when_missing_data_feed_options(data_feed: s

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", "Paper Trading",
"--data-feed", data_feed,
"--data-provider-live", data_feed,
"--live-cash-balance", "USD:100",
*options])

Expand Down Expand Up @@ -541,7 +541,7 @@ def test_live_non_interactive_do_not_store_non_persistent_properties_in_lean_con

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", brokerage,
"--data-feed", data_feed,
"--data-provider-live", data_feed,
*options])

traceback.print_exception(*result.exc_info)
Expand Down Expand Up @@ -583,7 +583,7 @@ def test_live_non_interactive_calls_run_lean_when_all_options_given(brokerage: s

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", brokerage,
"--data-feed", data_feed,
"--data-provider-live", data_feed,
*options])

traceback.print_exception(*result.exc_info)
Expand Down Expand Up @@ -622,8 +622,8 @@ def test_live_non_interactive_calls_run_lean_when_all_options_given_with_multipl

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", brokerage,
"--data-feed", data_feed1,
"--data-feed", data_feed2,
"--data-provider-live", data_feed1,
"--data-provider-live", data_feed2,
*options])

traceback.print_exception(*result.exc_info)
Expand Down Expand Up @@ -682,7 +682,7 @@ def test_live_non_interactive_falls_back_to_lean_config_for_brokerage_settings(b

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", brokerage,
"--data-feed", data_feed,
"--data-provider-live", data_feed,
*options])

traceback.print_exception(*result.exc_info)
Expand Down Expand Up @@ -731,7 +731,7 @@ def test_live_non_interactive_falls_back_to_lean_config_for_data_feed_settings(d

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", "Paper Trading",
"--data-feed", data_feed,
"--data-provider-live", data_feed,
"--live-cash-balance", "USD:100",
*options])

Expand Down Expand Up @@ -780,8 +780,8 @@ def test_live_non_interactive_falls_back_to_lean_config_for_multiple_data_feed_s

result = CliRunner().invoke(lean, ["live", "Python Project",
"--brokerage", "Paper Trading",
"--data-feed", data_feed1,
"--data-feed", data_feed2,
"--data-provider-live", data_feed1,
"--data-provider-live", data_feed2,
"--live-cash-balance", "USD:100",
*options])

Expand Down Expand Up @@ -924,7 +924,7 @@ def test_live_passes_live_cash_balance_to_lean_runner_when_given_as_option(broke

result = CliRunner().invoke(lean, ["live", "Python Project", *options,
"--brokerage", brokerage, "--live-cash-balance", cash,
"--data-feed", "Custom data only"])
"--data-provider-live", "Custom data only"])

if brokerage not in ["Paper Trading", "Trading Technologies", "Terminal Link"] and cash != "":
assert result.exit_code != 0
Expand Down Expand Up @@ -988,7 +988,7 @@ def test_live_passes_live_holdings_to_lean_runner_when_given_as_option(brokerage
options.extend(["--live-cash-balance", "USD:100"])

result = CliRunner().invoke(lean, ["live", "Python Project", "--brokerage", brokerage, "--live-holdings", holdings,
"--data-feed", "Custom data only", *options])
"--data-provider-live", "Custom data only", *options])

if brokerage not in ["Paper Trading", "Terminal Link"] and holdings != "":
assert result.exit_code != 0
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/test_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ def test_optimize_used_data_downloader_specified_with_data_provider_option() ->

with mock.patch.object(ModuleManager, "install_module"):
result = CliRunner().invoke(lean, ["optimize", "Python Project",
"--data-provider", "Polygon",
"--data-provider-historical", "Polygon",
"--polygon-api-key", "my-key"])

assert result.exit_code == 0
Expand Down

0 comments on commit e60cd97

Please sign in to comment.