This commit is contained in:
Alexander Myasoedov committed 2026-01-28 21:04:29 +02:00
1 parent 8d42a84a9d
commit bc7fdd7cfa
19 files changed
+491 -77

No files matched your search

+8 -4
View File
@@ -56,16 +56,20 @@ class TestRulesToDataset:
class TestLoadRulesAsDataset:
def test_basic_load(self):
with tempfile.TemporaryDirectory() as tmpdir:
(Path(tmpdir) / "rule1.yaml").write_text("""
(Path(tmpdir) / "rule1.yaml").write_text(
"""
name: test1
type: jailbreak
prompt: Jailbreak prompt
""")
(Path(tmpdir) / "rule2.yaml").write_text("""
"""
)
(Path(tmpdir) / "rule2.yaml").write_text(
"""
name: test2
type: harmful
prompt: Harmful prompt
""")
"""
)
dataset = load_rules_as_dataset(tmpdir)
assert len(dataset.prompts) == 2