from keepedu_performance import cli


def test_update_catalogs_includes_olympic_database(monkeypatch):
    executed: list[tuple[list[str], dict]] = []

    def fake_run(command, **kwargs):
        executed.append((command, kwargs))

    monkeypatch.setattr(cli.subprocess, "run", fake_run)

    cli.update_catalogs()

    modules = [command[-1] for command, _ in executed]
    assert "keepedu_performance.ingestion.xampp_db.premiacoes" in modules
    assert modules.index(
        "keepedu_performance.ingestion.xampp_db.premiacoes"
    ) < modules.index("keepedu_performance.processing.gold.dimensions")
    assert all(kwargs == {"check": True} for _, kwargs in executed)
