This commit is contained in:
Alexander Myasoedov
2026-01-28 21:04:29 +02:00
parent 8d42a84a9d
commit bc7fdd7cfa
19 changed files with 491 additions and 77 deletions
+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