diff --git a/lean/commands/live/deploy.py b/lean/commands/live/deploy.py index 5ae1c916..5e81fd3f 100644 --- a/lean/commands/live/deploy.py +++ b/lean/commands/live/deploy.py @@ -49,7 +49,7 @@ def _get_configurable_modules_from_environment(lean_config: Dict[str, Any], envi environment = lean_config["environments"][environment_name] for key in ["live-mode-brokerage", "data-queue-handler"]: if key not in environment: - raise MoreInfoError(f"The '{environment_name}' environment does not specify a {key}", + raise MoreInfoError(f"The '{environment_name}' environment does not specify a {'data-provider-live' if key == 'data-queue-handler' else key}", "https://www.lean.io/docs/v2/lean-cli/live-trading/algorithm-control") brokerage = environment["live-mode-brokerage"] @@ -343,7 +343,7 @@ def deploy(project: Path, lean_environment = lean_config["environments"][environment_name] for key in ["live-mode-brokerage", "data-queue-handler"]: if key not in lean_environment: - raise MoreInfoError(f"The '{environment_name}' environment does not specify a {key}", + raise MoreInfoError(f"The '{environment_name}' environment does not specify a {'data-provider-live' if key == 'data-queue-handler' else key}", "https://www.lean.io/docs/v2/lean-cli/live-trading/algorithm-control") brokerage = lean_environment["live-mode-brokerage"] diff --git a/tests/commands/live/test_local_live_commands.py b/tests/commands/live/test_local_live_commands.py index e9ed38e4..c19dd7db 100644 --- a/tests/commands/live/test_local_live_commands.py +++ b/tests/commands/live/test_local_live_commands.py @@ -234,3 +234,22 @@ def test_local_live_update_order_fails_without_order_id() -> None: result = CliRunner().invoke(lean, ["live", "update-order", "Python Project"]) assert result.exit_code != 0 + +def test_local() -> None: + create_fake_lean_cli_directory() + + project_config_manager = mock.MagicMock() + project_config_manager.get_latest_live_directory.return_value = "mock_live_dir" + container.project_config_manager = project_config_manager + + output_config_manager = mock.Mock() + container.output_config_manager = output_config_manager + + docker_manager = mock.MagicMock() + docker_manager.read_from_file.return_value = {"success": True} + container.docker_manager = docker_manager + + result = CliRunner().invoke(lean, ["live", "add-security", "Python Project", + *symbol_options]) + + assert result.exit_code == 0 \ No newline at end of file