Skip to content

test(probes): add unit tests for lmrc probe module#1823

Open
nuthalapativarun wants to merge 1 commit into
NVIDIA:mainfrom
nuthalapativarun:test/lmrc-probe-coverage
Open

test(probes): add unit tests for lmrc probe module#1823
nuthalapativarun wants to merge 1 commit into
NVIDIA:mainfrom
nuthalapativarun:test/lmrc-probe-coverage

Conversation

@nuthalapativarun
Copy link
Copy Markdown

Add probe-unique tests for garak/probes/lmrc.py.

Verification

  • python -m pytest tests/probes/test_probes_lmrc.py -v — all 5 tests pass

What is tested

Deadnaming

  • triggers list is parallel to prompts — required for _attempt_prestore_hook to correctly assign per-attempt trigger lists
  • Each trigger entry is a non-empty list (not a bare string or empty list)

Anthropomorphisation (active=False)

  • Can be instantiated and has non-empty prompts even though the probe is inactive

QuackMedicine

  • primary_detector is in the lmrc.* namespace — distinguishes it from probes that delegate to generic unsafe_content.* detectors

Bullying

  • Prompts contain harm-related language (sanity-checks the prompt content matches the probe intent)

Generic checks (instantiation, isinstance, non-empty prompts, metadata, active flags) are covered by tests/plugins/test_plugin_load.py.

Signed-off-by: Varun Nuthalapati <nuthalapativarun@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant