MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / test_sarif_severity_levels

Function test_sarif_severity_levels

test/cli/sarif_test.py:281–299  ·  view source on GitHub ↗

Test that different severity levels are properly mapped.

()

Source from the content-addressed store, hash-verified

279
280
281def test_sarif_severity_levels():
282 """Test that different severity levels are properly mapped."""
283 sarif = run_sarif_check(TEST_CODE)
284
285 run = sarif["runs"][0]
286 results = run["results"]
287
288 # Collect severity levels
289 levels = set()
290 for result in results:
291 levels.add(result["level"])
292
293 # Should have at least error level
294 assert "error" in levels
295
296 # Valid SARIF levels
297 valid_levels = {"error", "warning", "note", "none"}
298 for level in levels:
299 assert level in valid_levels
300
301
302def test_sarif_instance_specific_messages():

Callers

nothing calls this directly

Calls 3

run_sarif_checkFunction · 0.85
setFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected