Skip to content

Commit

Permalink
feat: validate raise error test
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Feb 15, 2024
1 parent a190ed9 commit 0b545cf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/commands/test_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,21 @@ def test_live_non_interactive_aborts_when_missing_data_feed_options(data_feed: s

container.lean_runner.run_lean.assert_not_called()

def test_live_non_interactive_raise_error_when_missing_data_provider_live_options() -> None:
create_fake_lean_cli_directory()

container.initialize(docker_manager=mock.Mock(), lean_runner=mock.Mock())

result = CliRunner().invoke(lean, ["live", "deploy" , "--brokerage", "Paper Trading", "Python Project"])

error_msg = str(result.exc_info[1]).split()

assert "data-provider-live" in error_msg
assert "data-queue-handler" not in error_msg

assert result.exit_code != 0



@pytest.mark.parametrize("brokerage,data_feed",
itertools.product(brokerage_required_options.keys(), data_feed_required_options.keys()))
Expand Down

0 comments on commit 0b545cf

Please sign in to comment.