Skip to content

Commit 611b444

Browse files
committed
Remove Python scenario render snapshot
1 parent 847601e commit 611b444

4 files changed

Lines changed: 1 addition & 81 deletions

File tree

‎tests/unit/harness/scenarios/software_criteria/control_flow_v1/expect/rendered.txt‎

Lines changed: 0 additions & 35 deletions
This file was deleted.

‎tests/unit/harness/scenarios/software_criteria/control_flow_v1/scenario.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ expected = "expect"
1212

1313
[policy_trigger]
1414
kind = "software-criterion"
15-
trigger = "pytest software criterion snapshot reads inputs/criterion.py and compares expect/findings.json plus expect/rendered.txt"
15+
trigger = "pytest software criterion JSON receipt reads inputs/criterion.py and compares expect/findings.json"
1616
evidence = "expect/findings.json"
1717
expected_rule_ids = ["PY-AGENT-POLICY-009", "PY-AGENT-POLICY-010", "PY-AGENT-POLICY-011"]
1818
expected_criteria = [

‎tests/unit/harness/test_software_criterion_snapshots.py‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66
from pathlib import Path
77
from typing import TYPE_CHECKING, Any
88

9-
from snapshot_support import normalize_temp_root
109
from syrupy.extensions.json import JSONSnapshotExtension
11-
from syrupy.extensions.single_file import SingleFileSnapshotExtension, WriteMode
1210

1311
from python_lang_project_harness import (
14-
render_python_lang_harness,
1512
run_python_lang_harness,
1613
)
1714

@@ -38,21 +35,6 @@ def get_file_basename(cls, *, test_location: Any, index: object) -> str:
3835
return super().get_file_basename(test_location=test_location, index=index)
3936

4037

41-
class _ScenarioTextSnapshotExtension(SingleFileSnapshotExtension):
42-
_write_mode = WriteMode.TEXT
43-
file_extension = "txt"
44-
45-
@classmethod
46-
def dirname(cls, *, test_location: Any) -> str:
47-
return str(_SCENARIO / "expect")
48-
49-
@classmethod
50-
def get_file_basename(cls, *, test_location: Any, index: object) -> str:
51-
if isinstance(index, str):
52-
return index
53-
return super().get_file_basename(test_location=test_location, index=index)
54-
55-
5638
def test_py_software_criterion_control_flow_v1_snapshot(
5739
tmp_path: Path,
5840
snapshot: SnapshotAssertion,
@@ -71,7 +53,6 @@ def test_py_software_criterion_control_flow_v1_snapshot(
7153
}
7254
for finding in filtered.findings
7355
]
74-
rendered = normalize_temp_root(render_python_lang_harness(filtered), tmp_path)
7556

7657
assert {finding["softwareCriteria"] for finding in findings} == {
7758
"control-flow.decision-stack",
@@ -84,10 +65,6 @@ def test_py_software_criterion_control_flow_v1_snapshot(
8465
snapshot(name="findings", extension_class=_ScenarioJsonSnapshotExtension)
8566
== findings
8667
)
87-
assert (
88-
snapshot(name="rendered", extension_class=_ScenarioTextSnapshotExtension)
89-
== rendered
90-
)
9168

9269

9370
def test_py_software_criterion_control_flow_v1_scenario_benchmark_contract() -> None:

‎tests/unit/snapshots/scenario_benchmark__python_control_flow_v1.snap‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)