Skip to content

DeepTeam is a framework to red team LLMs and AI agents.

updated tests to pass purpose for bola

A-Vamshifd10a124b9da
diff --git a/tests/test_core/test_red_teaming.py b/tests/test_core/test_red_teaming.py
index 60164cc5..42b242b8 100644
--- a/tests/test_core/test_red_teaming.py
+++ b/tests/test_core/test_red_teaming.py
@@ -31,7 +31,7 @@ def test_red_teaming():
PromptLeakage(purpose=PURPOSE),
PIILeakage(purpose=PURPOSE),
BFLA(purpose=PURPOSE),
- BOLA(),
+ BOLA(purpose=PURPOSE),
RBAC(purpose=PURPOSE),
DebugAccess(),
ShellInjection(),
diff --git a/tests/test_core/test_vulnerabilities/test_all.py b/tests/test_core/test_vulnerabilities/test_all.py
index be830967..e62471f6 100644
--- a/tests/test_core/test_vulnerabilities/test_all.py
+++ b/tests/test_core/test_vulnerabilities/test_all.py
@@ -30,7 +30,7 @@ def test_red_teaming():
PromptLeakage(purpose=PURPOSE),
PIILeakage(purpose=PURPOSE),
BFLA(purpose=PURPOSE),
- BOLA(),
+ BOLA(purpose=PURPOSE),
RBAC(purpose=PURPOSE),
DebugAccess(),
ShellInjection(),
diff --git a/tests/test_core/test_vulnerabilities/test_bola.py b/tests/test_core/test_vulnerabilities/test_bola.py
index 79929322..d2b2d524 100644
--- a/tests/test_core/test_vulnerabilities/test_bola.py
+++ b/tests/test_core/test_vulnerabilities/test_bola.py
@@ -5,6 +5,7 @@ from deepteam.vulnerabilities.bola import BOLAType
class TestBOLA:
+ PURPOSE = "purpose"
def test_bola_all_types(self):
types = [
@@ -12,28 +13,30 @@ class TestBOLA:
"cross_customer_access",
"unauthorized_object_manipulation",
]
- bola = BOLA(types=types)
+ bola = BOLA(purpose=TestBOLA.PURPOSE, types=types)
assert sorted(type.value for type in bola.types) == sorted(types)
def test_bola_all_types_default(self):
- bola = BOLA()
+ bola = BOLA(
+ purpose=TestBOLA.PURPOSE,
+ )
assert sorted(type.value for type in bola.types) == sorted(
type.value for type in BOLAType
)
def test_bola_object_access_bypass(self):
types = ["object_access_bypass"]
- bola = BOLA(types=types)
+ bola = BOLA(purpose=TestBOLA.PURPOSE, types=types)
assert sorted(type.value for type in bola.types) == sorted(types)
def test_bola_cross_customer_access(self):
types = ["cross_customer_access"]
- bola = BOLA(types=types)
+ bola = BOLA(purpose=TestBOLA.PURPOSE, types=types)
assert sorted(type.value for type in bola.types) == sorted(types)
def test_bola_unauthorized_object_manipulation(self):
types = ["unauthorized_object_manipulation"]
- bola = BOLA(types=types)
+ bola = BOLA(purpose=TestBOLA.PURPOSE, types=types)
assert sorted(type.value for type in bola.types) == sorted(types)
def test_bola_all_types_invalid(self):
@@ -44,4 +47,4 @@ class TestBOLA:
"invalid",
]
with pytest.raises(ValueError):
- BOLA(types=types)
+ BOLA(purpose=TestBOLA.PURPOSE, types=types)