Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make banner line test dynamic #670

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
import os

from garak import __version__, cli, _config
from garak import __app__, __description__, __version__, cli, _config

ansi_escape = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")

Expand All @@ -23,7 +23,7 @@ def test_probe_list(capsys):
for line in output.strip().split("\n"):
assert re.match(
r"^probes: [a-z0-9_]+(\.[A-Za-z0-9_]+)?( 🌟)?( 💤)?$", line
) or line.startswith("garak LLM security probe v")
) or line.startswith(f"{__app__} {__description__}")


def test_detector_list(capsys):
Expand All @@ -33,7 +33,7 @@ def test_detector_list(capsys):
for line in output.strip().split("\n"):
assert re.match(
r"^detectors: [a-z0-9_]+(\.[A-Za-z0-9_]+)?( 🌟)?( 💤)?$", line
) or line.startswith("garak LLM security probe v")
) or line.startswith(f"{__app__} {__description__}")


def test_generator_list(capsys):
Expand All @@ -43,7 +43,7 @@ def test_generator_list(capsys):
for line in output.strip().split("\n"):
assert re.match(
r"^generators: [a-z0-9_]+(\.[A-Za-z0-9_]+)?( 🌟)?( 💤)?$", line
) or line.startswith("garak LLM security probe v")
) or line.startswith(f"{__app__} {__description__}")


def test_buff_list(capsys):
Expand All @@ -53,7 +53,7 @@ def test_buff_list(capsys):
for line in output.strip().split("\n"):
assert re.match(
r"^buffs: [a-z0-9_]+(\.[A-Za-z0-9_]+)?( 🌟)?( 💤)?$", line
) or line.startswith("garak LLM security probe v")
) or line.startswith(f"{__app__} {__description__}")


def test_run_all_active_probes(capsys):
Expand Down
Loading