From 9d94febc4874f0c6e35776a24789229b89e7b77f Mon Sep 17 00:00:00 2001 From: Sultan Iman Date: Tue, 26 Mar 2024 09:51:11 +0100 Subject: [PATCH] Check if data persisted after the pipeline run --- tests/cli/test_run_command.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/cli/test_run_command.py b/tests/cli/test_run_command.py index 0a41083fbc..83b4438386 100644 --- a/tests/cli/test_run_command.py +++ b/tests/cli/test_run_command.py @@ -41,7 +41,20 @@ def test_run_command_happy_path_works_as_expected(): assert "contains no failed jobs" in output # Check if we can successfully attach to pipeline - dlt.attach(real_pipeline_name) + pipeline = dlt.attach(real_pipeline_name) + assert pipeline.schema_names == ["my_numbers"] + + trace = pipeline.last_trace + assert trace is not None + assert len(trace.steps) == 4 + + step = trace.steps[0] + assert step.step == "extract" + + with pipeline.sql_client() as c: + with c.execute_query("select count(id) from numbers_resource") as cur: + row = list(cur.fetchall())[0] + assert row[0] == 10 def test_run_command_fails_with_relevant_error_if_pipeline_resource_or_source_not_found():