"""Tests for agent pipeline control primitives."""

import pytest

pytest.importorskip("duckdb")


class TestPipelineRunStage:
    def test_dry_run_returns_planned_actions(self, tmp_duckdb_path):
        from agent_tools.pipeline import pipeline_run_stage

        result = pipeline_run_stage(tmp_duckdb_path, stage="svd", window_id="2024", dry_run=True)
        assert isinstance(result, dict)
        assert "stage" in result
        assert result.get("dry_run") is True


class TestPipelineGetLogs:
    def test_returns_log_lines(self, tmp_duckdb_path):
        from agent_tools.pipeline import pipeline_get_logs

        result = pipeline_get_logs(tmp_duckdb_path, stage="svd", lines=10)
        assert isinstance(result, list)
        assert len(result) <= 10
