From 01546e8b13730b97bc11a71b7bb315666c774e04 Mon Sep 17 00:00:00 2001 From: Sultan Iman Date: Mon, 25 Mar 2024 15:09:25 +0100 Subject: [PATCH] Add more tests --- dlt/cli/run_command.py | 1 - tests/cli/test_run_command.py | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dlt/cli/run_command.py b/dlt/cli/run_command.py index 4b884a8a66..0575f4e39e 100644 --- a/dlt/cli/run_command.py +++ b/dlt/cli/run_command.py @@ -39,7 +39,6 @@ def run_pipeline_command( with PipelineRunner(params=params) as runner: load_info = runner.run() fmt.echo("") - # FIXME: provide more useful information fmt.echo(load_info) except PipelineStepFailed: raise diff --git a/tests/cli/test_run_command.py b/tests/cli/test_run_command.py index 7b252171ad..1676aa2a3d 100644 --- a/tests/cli/test_run_command.py +++ b/tests/cli/test_run_command.py @@ -84,6 +84,21 @@ def test_run_command_allows_selection_of_pipeline_source_or_resource(): assert mocked_ask.call_count == 2 +def test_run_command_exits_if_exit_choice_selected(): + with mock.patch( + "dlt.common.cli.runner.inquirer.fmt.prompt", return_value="n" + ), io.StringIO() as buf, contextlib.redirect_stdout(buf): + run_command.run_pipeline_command( + str(TEST_PIPELINE), + None, + None, + ["write_disposition=append", "loader_file_format=parquet"], + ) + + output = buf.getvalue() + assert "Stopping..." in output + + def test_run_command_exits_if_pipeline_run_calls_exist_at_the_top_level(): with io.StringIO() as buf, contextlib.redirect_stdout(buf): run_command.run_pipeline_command(