Commit f41b9b5
committed
test(wl_audit): close item E mutmut survivors 55+88 + re-classify 17 as equivalent
Item G1 of v1.1 test-coverage push.
Closes 2 of the 3 higher-value wl_audit.py survivors from item E
(2026-05-19) with surgical mock-based unit tests in
TestAuditMutationCoverageGaps:
- test_authorization_header_exact_splunk_prefix kills mutant 55
(line 156: `"Splunk %s"` → `"XXSplunk %sXX"`). The existing
test_post_audit_event_sets_headers uses substring `in`, which
the mutated header `"XXSplunk <key>XX"` slips past. New test
asserts exact equality on the full header value.
- test_generic_exception_returns_non_empty_error_message kills
mutant 88 (line 189: `error_msg = str(e)` → `error_msg = None`
in the generic exception handler). No prior test exercised
this branch (existing tests only triggered HTTPError, URLError,
socket.timeout). New test injects RuntimeError via
mock_urlopen.side_effect and asserts error_msg is non-None +
non-empty + contains the original exception's text.
Mutant 17 (line 91: kwarg-filter string `"app_context"` →
`"XXapp_contextXX"`) re-classified as EQUIVALENT. The original
item-E triage claimed it was killable via len(event) assertions,
but closer analysis showed the loop's second write to
event["app_context"] is idempotent — both line-85 and the loop's
line-92 pull from the same kwargs dict, so the dict overwrite has
no observable effect. Documented in MUTATION_TESTING.md.
Manual verification (apply mutation → run new test → confirm
assertion failure → restore):
- Mutant 55 applied: test fails with
`expected "Splunk MY_SESSION_KEY_12345", got "XXSplunk
MY_SESSION_KEY_12345XX"`
- Mutant 88 applied: test fails with
`assert None is not None`
- After restore: 614/614 unit tests pass (+2 from prior 612)
Coverage delta: bin/wl_audit.py 84% → 89% (+5pp).
Effective wl_audit kill rate: 55/90 → 57/90 (61% → 63%).
Remaining 33 survivors are in lower-value classes (log/error
message text, equivalent HTTP-status edge cases, integration-only
paths) per the item-E triage table.1 parent b7026dc commit f41b9b5
2 files changed
Lines changed: 127 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
326 | 331 | | |
327 | 332 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
332 | 343 | | |
333 | 344 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
344 | 364 | | |
345 | 365 | | |
346 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
0 commit comments