Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sultaniman committed Mar 25, 2024
1 parent 63b0b3c commit 01546e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion dlt/cli/run_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions tests/cli/test_run_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 01546e8

Please sign in to comment.