25 lines
931 B
Python
25 lines
931 B
Python
"""Presentation export–aligned checks (reference path and portable pieces)."""
|
||
|
||
from pathlib import Path
|
||
|
||
import pytest
|
||
from applepy.checks.deck_export import check_deck_export_reference, check_kube_config_presence
|
||
from applepy.context import RunContext
|
||
|
||
|
||
def test_deck_reference_finds_export(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
|
||
monkeypatch.chdir(tmp_path)
|
||
name = "APPLEPY_DECK_REFERENCE.txt"
|
||
(tmp_path / name).write_text("stub export\n", encoding="utf-8")
|
||
ctx = RunContext(home=tmp_path, output_dir=tmp_path, phase="unprivileged")
|
||
out = check_deck_export_reference(ctx)
|
||
assert len(out) == 1
|
||
assert out[0].id == "deck-000"
|
||
assert "located" in out[0].title.lower()
|
||
|
||
|
||
def test_kube_config_absent(tmp_path: Path) -> None:
|
||
ctx = RunContext(home=tmp_path, output_dir=tmp_path, phase="unprivileged")
|
||
out = check_kube_config_presence(ctx)
|
||
assert out[0].id == "deck-104"
|