Skip to content

Commit 60415f0

Browse files
committed
fix test_cli to properly test manifest linting
1 parent 6834470 commit 60415f0

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tests/test_cli.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,11 @@ def test_invalid_options():
2020

2121
def test_lint_existing_manifest(manifest_path):
2222
"""Test lint with an existing manifest."""
23-
with patch("dbt_score.cli.lint_dbt_project") as mock_lint:
24-
mock_eval = MagicMock()
25-
mock_eval.project_score = Score(10.0, "🥇")
26-
mock_eval.scores.values.return_value = []
27-
mock_lint.return_value = mock_eval
28-
29-
runner = CliRunner()
23+
runner = CliRunner()
24+
# We want to actually test linting the manifest
25+
with patch("dbt_score.cli.Config._load_toml_file"):
3026
result = runner.invoke(lint, ["--manifest", manifest_path, "--show", "all"])
31-
32-
assert result.exit_code == 0
27+
assert result.exit_code == 1 # Expected to fail due to rules in test data
3328

3429

3530
def test_lint_non_existing_manifest(caplog):
@@ -107,7 +102,6 @@ def test_fail_project_under(manifest_path):
107102

108103
with patch("dbt_score.cli.lint_dbt_project") as mock_lint:
109104
mock_lint.return_value = mock_eval
110-
# Also patch the HumanReadableFormatter to control the output
111105
runner = CliRunner()
112106
result = runner.invoke(
113107
lint, ["--manifest", manifest_path, "--fail-project-under", "10.0"]

0 commit comments

Comments
 (0)