MCPcopy Create free account
hub / github.com/anthropics/defending-code-reference-harness / test_parse_token

Function test_parse_token

tests/test_report.py:27–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26
27def test_parse_token():
28 assert _parse_token("<severity>CRITICAL — justification</severity>",
29 "severity", ("CRITICAL", "HIGH"), "NOT_STATED") == "CRITICAL"
30 assert _parse_token("<reachability>This is reachable from the public API</reachability>",
31 "reachability", ("REACHABLE", "HARNESS_ONLY"), "UNCLEAR") == "REACHABLE"
32 assert _parse_token("<severity></severity>",
33 "severity", ("CRITICAL", "HIGH"), "NOT_STATED") == "NOT_STATED"
34
35
36GRADER_OUTPUT = """\

Callers

nothing calls this directly

Calls 1

_parse_tokenFunction · 0.90

Tested by

no test coverage detected