Skip to content

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

updated tests

A-Vamshi596ccfed5dd6
diff --git a/tests/test_core/test_red_teaming.py b/tests/test_core/test_red_teaming.py
index 32c75b34..bf15aaec 100644
--- a/tests/test_core/test_red_teaming.py
+++ b/tests/test_core/test_red_teaming.py
@@ -9,12 +9,6 @@ async def model_callback(input: str) -> str:
def test_red_teaming():
- PURPOSE = "purpose"
- TOXICITY = "category"
- GRAPHIC = "category"
- SAFETY = "category"
- MISINFORMATION = "category"
- ILLEGAL = "category"
custom_vulnerability = CustomVulnerability(
criteria="Criteria",
@@ -24,28 +18,28 @@ def test_red_teaming():
)
vulnerabilities = [
- Bias(purpose=PURPOSE),
- Toxicity(toxicity_category=TOXICITY),
- Misinformation(misinformation_category=MISINFORMATION),
- IllegalActivity(illegal_category=ILLEGAL),
- PromptLeakage(purpose=PURPOSE),
- PIILeakage(purpose=PURPOSE),
- BFLA(purpose=PURPOSE),
- BOLA(purpose=PURPOSE),
- RBAC(purpose=PURPOSE),
- DebugAccess(purpose=PURPOSE),
- ShellInjection(purpose=PURPOSE),
- SQLInjection(purpose=PURPOSE),
- SSRF(purpose=PURPOSE),
- IntellectualProperty(purpose=PURPOSE),
- Competition(purpose=PURPOSE),
- GraphicContent(graphic_category=GRAPHIC),
- PersonalSafety(safety_category=SAFETY),
+ Bias(),
+ Toxicity(),
+ Misinformation(),
+ IllegalActivity(),
+ PromptLeakage(),
+ PIILeakage(),
+ BFLA(),
+ BOLA(),
+ RBAC(),
+ DebugAccess(),
+ ShellInjection(),
+ SQLInjection(),
+ SSRF(),
+ IntellectualProperty(),
+ Competition(),
+ GraphicContent(),
+ PersonalSafety(),
# Agentic vulnerabilities
- GoalTheft(purpose=PURPOSE),
- RecursiveHijacking(purpose=PURPOSE),
- Robustness(purpose=PURPOSE),
- ExcessiveAgency(purpose=PURPOSE),
+ GoalTheft(),
+ RecursiveHijacking(),
+ Robustness(),
+ ExcessiveAgency(),
custom_vulnerability,
]
diff --git a/tests/test_core/test_vulnerabilities/test_all.py b/tests/test_core/test_vulnerabilities/test_all.py
index fbd222fd..95f16c08 100644
--- a/tests/test_core/test_vulnerabilities/test_all.py
+++ b/tests/test_core/test_vulnerabilities/test_all.py
@@ -8,12 +8,6 @@ async def model_callback(input: str) -> str:
def test_red_teaming():
- PURPOSE = "purpose"
- TOXICITY = "category"
- GRAPHIC = "category"
- SAFETY = "category"
- MISINFORMATION = "category"
- ILLEGAL = "category"
custom_vulnerability = CustomVulnerability(
criteria="Criteria",
@@ -23,28 +17,28 @@ def test_red_teaming():
)
vulnerabilities = [
- Bias(purpose=PURPOSE),
- Toxicity(toxicity_category=TOXICITY),
- Misinformation(misinformation_category=MISINFORMATION),
- IllegalActivity(illegal_category=ILLEGAL),
- PromptLeakage(purpose=PURPOSE),
- PIILeakage(purpose=PURPOSE),
- BFLA(purpose=PURPOSE),
- BOLA(purpose=PURPOSE),
- RBAC(purpose=PURPOSE),
- DebugAccess(purpose=PURPOSE),
- ShellInjection(purpose=PURPOSE),
- SQLInjection(purpose=PURPOSE),
- SSRF(purpose=PURPOSE),
- IntellectualProperty(purpose=PURPOSE),
- Competition(purpose=PURPOSE),
- GraphicContent(graphic_category=GRAPHIC),
- PersonalSafety(safety_category=SAFETY),
+ Bias(),
+ Toxicity(),
+ Misinformation(),
+ IllegalActivity(),
+ PromptLeakage(),
+ PIILeakage(),
+ BFLA(),
+ BOLA(),
+ RBAC(),
+ DebugAccess(),
+ ShellInjection(),
+ SQLInjection(),
+ SSRF(),
+ IntellectualProperty(),
+ Competition(),
+ GraphicContent(),
+ PersonalSafety(),
# Agentic vulnerabilities
- GoalTheft(purpose=PURPOSE),
- RecursiveHijacking(purpose=PURPOSE),
- Robustness(purpose=PURPOSE),
- ExcessiveAgency(purpose=PURPOSE),
+ GoalTheft(),
+ RecursiveHijacking(),
+ Robustness(),
+ ExcessiveAgency(),
custom_vulnerability,
]
diff --git a/tests/test_core/test_vulnerabilities/test_bfla.py b/tests/test_core/test_vulnerabilities/test_bfla.py
index e55ca060..c889f46d 100644
--- a/tests/test_core/test_vulnerabilities/test_bfla.py
+++ b/tests/test_core/test_vulnerabilities/test_bfla.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.bfla import BFLAType
class TestBFLA:
- PURPOSE = "purpose"
def test_bfla_all_types(self):
types = [
@@ -13,30 +12,28 @@ class TestBFLA:
"function_bypass",
"authorization_bypass",
]
- bfla = BFLA(purpose=TestBFLA.PURPOSE, types=types)
+ bfla = BFLA(types=types)
assert sorted(type.value for type in bfla.types) == sorted(types)
def test_bfla_all_types_default(self):
- bfla = BFLA(
- purpose=TestBFLA.PURPOSE,
- )
+ bfla = BFLA()
assert sorted(type.value for type in bfla.types) == sorted(
type.value for type in BFLAType
)
def test_bfla_privilege_escalation(self):
types = ["privilege_escalation"]
- bfla = BFLA(purpose=TestBFLA.PURPOSE, types=types)
+ bfla = BFLA(types=types)
assert sorted(type.value for type in bfla.types) == sorted(types)
def test_bfla_function_bypass(self):
types = ["function_bypass"]
- bfla = BFLA(purpose=TestBFLA.PURPOSE, types=types)
+ bfla = BFLA(types=types)
assert sorted(type.value for type in bfla.types) == sorted(types)
def test_bfla_authorization_bypass(self):
types = ["authorization_bypass"]
- bfla = BFLA(purpose=TestBFLA.PURPOSE, types=types)
+ bfla = BFLA(types=types)
assert sorted(type.value for type in bfla.types) == sorted(types)
def test_bfla_all_types_invalid(self):
@@ -47,4 +44,4 @@ class TestBFLA:
"invalid",
]
with pytest.raises(ValueError):
- BFLA(purpose=TestBFLA.PURPOSE, types=types)
+ BFLA(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_bias.py b/tests/test_core/test_vulnerabilities/test_bias.py
index 3f5e6e64..fe792d01 100644
--- a/tests/test_core/test_vulnerabilities/test_bias.py
+++ b/tests/test_core/test_vulnerabilities/test_bias.py
@@ -5,42 +5,39 @@ from deepteam.vulnerabilities.bias import BiasType
class TestBias:
- PURPOSE = "purpose"
def test_bias_all_types(self):
types = ["gender", "politics", "religion", "race"]
- bias = Bias(purpose=TestBias.PURPOSE, types=types)
+ bias = Bias(types=types)
assert sorted(type.value for type in bias.types) == sorted(types)
def test_bias_all_types_default(self):
- bias = Bias(
- purpose=TestBias.PURPOSE,
- )
+ bias = Bias()
assert sorted(type.value for type in bias.types) == sorted(
type.value for type in BiasType
)
def test_bias_gender(self):
types = ["gender"]
- bias = Bias(purpose=TestBias.PURPOSE, types=types)
+ bias = Bias(types=types)
assert sorted(type.value for type in bias.types) == sorted(types)
def test_bias_politics(self):
types = ["politics"]
- bias = Bias(purpose=TestBias.PURPOSE, types=types)
+ bias = Bias(types=types)
assert sorted(type.value for type in bias.types) == sorted(types)
def test_bias_religion(self):
types = ["religion"]
- bias = Bias(purpose=TestBias.PURPOSE, types=types)
+ bias = Bias(types=types)
assert sorted(type.value for type in bias.types) == sorted(types)
def test_bias_race(self):
types = ["race"]
- bias = Bias(purpose=TestBias.PURPOSE, types=types)
+ bias = Bias(types=types)
assert sorted(type.value for type in bias.types) == sorted(types)
def test_bias_all_types_invalid(self):
types = ["gender", "politics", "religion", "race", "invalid"]
with pytest.raises(ValueError):
- Bias(purpose=TestBias.PURPOSE, types=types)
+ Bias(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_bola.py b/tests/test_core/test_vulnerabilities/test_bola.py
index d2b2d524..79929322 100644
--- a/tests/test_core/test_vulnerabilities/test_bola.py
+++ b/tests/test_core/test_vulnerabilities/test_bola.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.bola import BOLAType
class TestBOLA:
- PURPOSE = "purpose"
def test_bola_all_types(self):
types = [
@@ -13,30 +12,28 @@ class TestBOLA:
"cross_customer_access",
"unauthorized_object_manipulation",
]
- bola = BOLA(purpose=TestBOLA.PURPOSE, types=types)
+ bola = BOLA(types=types)
assert sorted(type.value for type in bola.types) == sorted(types)
def test_bola_all_types_default(self):
- bola = BOLA(
- purpose=TestBOLA.PURPOSE,
- )
+ bola = BOLA()
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(purpose=TestBOLA.PURPOSE, types=types)
+ bola = BOLA(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(purpose=TestBOLA.PURPOSE, types=types)
+ bola = BOLA(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(purpose=TestBOLA.PURPOSE, types=types)
+ bola = BOLA(types=types)
assert sorted(type.value for type in bola.types) == sorted(types)
def test_bola_all_types_invalid(self):
@@ -47,4 +44,4 @@ class TestBOLA:
"invalid",
]
with pytest.raises(ValueError):
- BOLA(purpose=TestBOLA.PURPOSE, types=types)
+ BOLA(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_competition.py b/tests/test_core/test_vulnerabilities/test_competition.py
index c9eb7d1b..741b2529 100644
--- a/tests/test_core/test_vulnerabilities/test_competition.py
+++ b/tests/test_core/test_vulnerabilities/test_competition.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.competition import CompetitionType
class TestCompetition:
- PURPOSE = "purpose"
def test_competition_all_types(self):
types = [
@@ -14,35 +13,33 @@ class TestCompetition:
"discreditation",
"confidential strategies",
]
- competition = Competition(purpose=TestCompetition.PURPOSE, types=types)
+ competition = Competition(types=types)
assert sorted(type.value for type in competition.types) == sorted(types)
def test_competition_all_types_default(self):
- competition = Competition(
- purpose=TestCompetition.PURPOSE,
- )
+ competition = Competition()
assert sorted(type.value for type in competition.types) == sorted(
type.value for type in CompetitionType
)
def test_competition_competitor_mention(self):
types = ["competitor mention"]
- competition = Competition(purpose=TestCompetition.PURPOSE, types=types)
+ competition = Competition(types=types)
assert sorted(type.value for type in competition.types) == sorted(types)
def test_competition_market_manipulation(self):
types = ["market manipulation"]
- competition = Competition(purpose=TestCompetition.PURPOSE, types=types)
+ competition = Competition(types=types)
assert sorted(type.value for type in competition.types) == sorted(types)
def test_competition_discreditation(self):
types = ["discreditation"]
- competition = Competition(purpose=TestCompetition.PURPOSE, types=types)
+ competition = Competition(types=types)
assert sorted(type.value for type in competition.types) == sorted(types)
def test_competition_confidential_strategies(self):
types = ["confidential strategies"]
- competition = Competition(purpose=TestCompetition.PURPOSE, types=types)
+ competition = Competition(types=types)
assert sorted(type.value for type in competition.types) == sorted(types)
def test_competition_all_types_invalid(self):
@@ -54,4 +51,4 @@ class TestCompetition:
"invalid",
]
with pytest.raises(ValueError):
- Competition(purpose=TestCompetition.PURPOSE, types=types)
+ Competition(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_debug_access.py b/tests/test_core/test_vulnerabilities/test_debug_access.py
index cfbe42f8..5b0300a5 100644
--- a/tests/test_core/test_vulnerabilities/test_debug_access.py
+++ b/tests/test_core/test_vulnerabilities/test_debug_access.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.debug_access import DebugAccessType
class TestDebugAccess:
- PURPOSE = "purpose"
def test_debug_access_all_types(self):
types = [
@@ -13,36 +12,34 @@ class TestDebugAccess:
"development_endpoint_access",
"administrative_interface_exposure",
]
- debug_access = DebugAccess(purpose=TestDebugAccess.PURPOSE, types=types)
+ debug_access = DebugAccess(types=types)
assert sorted(type.value for type in debug_access.types) == sorted(
types
)
def test_debug_access_all_types_default(self):
- debug_access = DebugAccess(
- purpose=TestDebugAccess.PURPOSE,
- )
+ debug_access = DebugAccess()
assert sorted(type.value for type in debug_access.types) == sorted(
type.value for type in DebugAccessType
)
def test_debug_access_debug_mode_bypass(self):
types = ["debug_mode_bypass"]
- debug_access = DebugAccess(purpose=TestDebugAccess.PURPOSE, types=types)
+ debug_access = DebugAccess(types=types)
assert sorted(type.value for type in debug_access.types) == sorted(
types
)
def test_debug_access_development_endpoint_access(self):
types = ["development_endpoint_access"]
- debug_access = DebugAccess(purpose=TestDebugAccess.PURPOSE, types=types)
+ debug_access = DebugAccess(types=types)
assert sorted(type.value for type in debug_access.types) == sorted(
types
)
def test_debug_access_administrative_interface_exposure(self):
types = ["administrative_interface_exposure"]
- debug_access = DebugAccess(purpose=TestDebugAccess.PURPOSE, types=types)
+ debug_access = DebugAccess(types=types)
assert sorted(type.value for type in debug_access.types) == sorted(
types
)
@@ -55,4 +52,4 @@ class TestDebugAccess:
"invalid",
]
with pytest.raises(ValueError):
- DebugAccess(purpose=TestDebugAccess.PURPOSE, types=types)
+ DebugAccess(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_excessive_agency.py b/tests/test_core/test_vulnerabilities/test_excessive_agency.py
index b61df40f..88af37a2 100644
--- a/tests/test_core/test_vulnerabilities/test_excessive_agency.py
+++ b/tests/test_core/test_vulnerabilities/test_excessive_agency.py
@@ -7,21 +7,18 @@ from deepteam.vulnerabilities.agentic.excessive_agency import (
class TestExcessiveAgency:
- PURPOSE = "purpose"
def test_excessive_agency_all_types(self):
types = ["functionality", "permissions", "autonomy"]
excessive_agency = ExcessiveAgency(
- purpose=TestExcessiveAgency.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in excessive_agency.types) == sorted(
types
)
def test_excessive_agency_all_types_default(self):
- excessive_agency = ExcessiveAgency(
- purpose=TestExcessiveAgency.PURPOSE,
- )
+ excessive_agency = ExcessiveAgency()
assert sorted(type.value for type in excessive_agency.types) == sorted(
type.value for type in ExcessiveAgencyType
)
@@ -29,7 +26,7 @@ class TestExcessiveAgency:
def test_excessive_agency_functionality(self):
types = ["functionality"]
excessive_agency = ExcessiveAgency(
- purpose=TestExcessiveAgency.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in excessive_agency.types) == sorted(
types
@@ -38,7 +35,7 @@ class TestExcessiveAgency:
def test_excessive_agency_permissions(self):
types = ["permissions"]
excessive_agency = ExcessiveAgency(
- purpose=TestExcessiveAgency.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in excessive_agency.types) == sorted(
types
@@ -47,7 +44,7 @@ class TestExcessiveAgency:
def test_excessive_agency_autonomy(self):
types = ["autonomy"]
excessive_agency = ExcessiveAgency(
- purpose=TestExcessiveAgency.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in excessive_agency.types) == sorted(
types
@@ -56,4 +53,4 @@ class TestExcessiveAgency:
def test_excessive_agency_all_types_invalid(self):
types = ["functionality", "permissions", "autonomy", "invalid"]
with pytest.raises(ValueError):
- ExcessiveAgency(purpose=TestExcessiveAgency.PURPOSE, types=types)
+ ExcessiveAgency(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_goal_theft.py b/tests/test_core/test_vulnerabilities/test_goal_theft.py
index 70015d8d..0b4d09b4 100644
--- a/tests/test_core/test_vulnerabilities/test_goal_theft.py
+++ b/tests/test_core/test_vulnerabilities/test_goal_theft.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.agentic.goal_theft import GoalTheftType
class TestGoalTheft:
- PURPOSE = "purpose"
def test_goal_theft_all_types(self):
types = [
@@ -13,30 +12,28 @@ class TestGoalTheft:
"cooperative_dialogue",
"social_engineering",
]
- goal_theft = GoalTheft(purpose=TestGoalTheft.PURPOSE, types=types)
+ goal_theft = GoalTheft(types=types)
assert sorted(type.value for type in goal_theft.types) == sorted(types)
def test_goal_theft_all_types_default(self):
- goal_theft = GoalTheft(
- purpose=TestGoalTheft.PURPOSE,
- )
+ goal_theft = GoalTheft()
assert sorted(type.value for type in goal_theft.types) == sorted(
type.value for type in GoalTheftType
)
def test_goal_theft_escalating_probing(self):
types = ["escalating_probing"]
- goal_theft = GoalTheft(purpose=TestGoalTheft.PURPOSE, types=types)
+ goal_theft = GoalTheft(types=types)
assert sorted(type.value for type in goal_theft.types) == sorted(types)
def test_goal_theft_cooperative_dialogue(self):
types = ["cooperative_dialogue"]
- goal_theft = GoalTheft(purpose=TestGoalTheft.PURPOSE, types=types)
+ goal_theft = GoalTheft(types=types)
assert sorted(type.value for type in goal_theft.types) == sorted(types)
def test_goal_theft_social_engineering(self):
types = ["social_engineering"]
- goal_theft = GoalTheft(purpose=TestGoalTheft.PURPOSE, types=types)
+ goal_theft = GoalTheft(types=types)
assert sorted(type.value for type in goal_theft.types) == sorted(types)
def test_goal_theft_all_types_invalid(self):
@@ -47,4 +44,4 @@ class TestGoalTheft:
"invalid",
]
with pytest.raises(ValueError):
- GoalTheft(purpose=TestGoalTheft.PURPOSE, types=types)
+ GoalTheft(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_graphic_content.py b/tests/test_core/test_vulnerabilities/test_graphic_content.py
index 9d6fbac2..9895c0e9 100644
--- a/tests/test_core/test_vulnerabilities/test_graphic_content.py
+++ b/tests/test_core/test_vulnerabilities/test_graphic_content.py
@@ -5,21 +5,18 @@ from deepteam.vulnerabilities.graphic_content import GraphicContentType
class TestGraphicContent:
- GRAPHIC = "category"
def test_graphic_content_all_types(self):
types = ["sexual content", "graphic content", "pornographic content"]
graphic_content = GraphicContent(
- graphic_category=TestGraphicContent.GRAPHIC, types=types
+ types=types
)
assert sorted(type.value for type in graphic_content.types) == sorted(
types
)
def test_graphic_content_all_types_default(self):
- graphic_content = GraphicContent(
- graphic_category=TestGraphicContent.GRAPHIC,
- )
+ graphic_content = GraphicContent()
assert sorted(type.value for type in graphic_content.types) == sorted(
type.value for type in GraphicContentType
)
@@ -27,7 +24,7 @@ class TestGraphicContent:
def test_graphic_content_sexual_content(self):
types = ["sexual content"]
graphic_content = GraphicContent(
- graphic_category=TestGraphicContent.GRAPHIC, types=types
+ types=types
)
assert sorted(type.value for type in graphic_content.types) == sorted(
types
@@ -36,7 +33,7 @@ class TestGraphicContent:
def test_graphic_content_graphic_content(self):
types = ["graphic content"]
graphic_content = GraphicContent(
- graphic_category=TestGraphicContent.GRAPHIC, types=types
+ types=types
)
assert sorted(type.value for type in graphic_content.types) == sorted(
types
@@ -45,7 +42,7 @@ class TestGraphicContent:
def test_graphic_content_pornographic_content(self):
types = ["pornographic content"]
graphic_content = GraphicContent(
- graphic_category=TestGraphicContent.GRAPHIC, types=types
+ types=types
)
assert sorted(type.value for type in graphic_content.types) == sorted(
types
@@ -60,5 +57,5 @@ class TestGraphicContent:
]
with pytest.raises(ValueError):
GraphicContent(
- graphic_category=TestGraphicContent.GRAPHIC, types=types
+ types=types
)
diff --git a/tests/test_core/test_vulnerabilities/test_illegal_activity.py b/tests/test_core/test_vulnerabilities/test_illegal_activity.py
index a84b00ad..a6fd08ea 100644
--- a/tests/test_core/test_vulnerabilities/test_illegal_activity.py
+++ b/tests/test_core/test_vulnerabilities/test_illegal_activity.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.illegal_activity import IllegalActivityType
class TestIllegalActivity:
- ILLEGAL = "category"
def test_illegal_activity_all_types(self):
types = [
@@ -18,16 +17,14 @@ class TestIllegalActivity:
"child exploitation",
]
illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
assert sorted(type.value for type in illegal_activity.types) == sorted(
types
)
def test_illegal_activity_all_types_default(self):
- illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL,
- )
+ illegal_activity = IllegalActivity()
assert sorted(type.value for type in illegal_activity.types) == sorted(
type.value for type in IllegalActivityType
)
@@ -35,7 +32,7 @@ class TestIllegalActivity:
def test_illegal_activity_weapons(self):
types = ["weapons"]
illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
assert sorted(type.value for type in illegal_activity.types) == sorted(
types
@@ -44,7 +41,7 @@ class TestIllegalActivity:
def test_illegal_activity_illegal_drugs(self):
types = ["illegal drugs"]
illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
assert sorted(type.value for type in illegal_activity.types) == sorted(
types
@@ -53,7 +50,7 @@ class TestIllegalActivity:
def test_illegal_activity_violent_crimes(self):
types = ["violent crimes"]
illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
assert sorted(type.value for type in illegal_activity.types) == sorted(
types
@@ -62,7 +59,7 @@ class TestIllegalActivity:
def test_illegal_activity_non_violent_crimes(self):
types = ["non violent crimes"]
illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
assert sorted(type.value for type in illegal_activity.types) == sorted(
types
@@ -71,7 +68,7 @@ class TestIllegalActivity:
def test_illegal_activity_sex_crimes(self):
types = ["sex crimes"]
illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
assert sorted(type.value for type in illegal_activity.types) == sorted(
types
@@ -80,7 +77,7 @@ class TestIllegalActivity:
def test_illegal_activity_cybercrime(self):
types = ["cybercrime"]
illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
assert sorted(type.value for type in illegal_activity.types) == sorted(
types
@@ -89,7 +86,7 @@ class TestIllegalActivity:
def test_illegal_activity_child_exploitation(self):
types = ["child exploitation"]
illegal_activity = IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
assert sorted(type.value for type in illegal_activity.types) == sorted(
types
@@ -108,5 +105,5 @@ class TestIllegalActivity:
]
with pytest.raises(ValueError):
IllegalActivity(
- illegal_category=TestIllegalActivity.ILLEGAL, types=types
+ types=types
)
diff --git a/tests/test_core/test_vulnerabilities/test_intellectual_property.py b/tests/test_core/test_vulnerabilities/test_intellectual_property.py
index 0c8ee95a..130b9fca 100644
--- a/tests/test_core/test_vulnerabilities/test_intellectual_property.py
+++ b/tests/test_core/test_vulnerabilities/test_intellectual_property.py
@@ -7,7 +7,6 @@ from deepteam.vulnerabilities.intellectual_property import (
class TestIntellectualProperty:
- PURPOSE = "purpose"
def test_intellectual_property_all_types(self):
types = [
@@ -17,16 +16,14 @@ class TestIntellectualProperty:
"patent disclosure",
]
intellectual_property = IntellectualProperty(
- purpose=TestIntellectualProperty.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in intellectual_property.types
) == sorted(types)
def test_intellectual_property_all_types_default(self):
- intellectual_property = IntellectualProperty(
- purpose=TestIntellectualProperty.PURPOSE,
- )
+ intellectual_property = IntellectualProperty()
assert sorted(
type.value for type in intellectual_property.types
) == sorted(type.value for type in IntellectualPropertyType)
@@ -34,7 +31,7 @@ class TestIntellectualProperty:
def test_intellectual_property_imitation(self):
types = ["imitation"]
intellectual_property = IntellectualProperty(
- purpose=TestIntellectualProperty.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in intellectual_property.types
@@ -43,7 +40,7 @@ class TestIntellectualProperty:
def test_intellectual_property_copyright_violations(self):
types = ["copyright violations"]
intellectual_property = IntellectualProperty(
- purpose=TestIntellectualProperty.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in intellectual_property.types
@@ -52,7 +49,7 @@ class TestIntellectualProperty:
def test_intellectual_property_trademark_infringement(self):
types = ["trademark infringement"]
intellectual_property = IntellectualProperty(
- purpose=TestIntellectualProperty.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in intellectual_property.types
@@ -61,7 +58,7 @@ class TestIntellectualProperty:
def test_intellectual_property_patent_disclosure(self):
types = ["patent disclosure"]
intellectual_property = IntellectualProperty(
- purpose=TestIntellectualProperty.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in intellectual_property.types
@@ -77,5 +74,5 @@ class TestIntellectualProperty:
]
with pytest.raises(ValueError):
IntellectualProperty(
- purpose=TestIntellectualProperty.PURPOSE, types=types
+ types=types
)
diff --git a/tests/test_core/test_vulnerabilities/test_misinformation.py b/tests/test_core/test_vulnerabilities/test_misinformation.py
index b99a5063..ba3611cf 100644
--- a/tests/test_core/test_vulnerabilities/test_misinformation.py
+++ b/tests/test_core/test_vulnerabilities/test_misinformation.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.misinformation import MisinformationType
class TestMisinformation:
- MISINFORMATION = "category"
def test_misinformation_all_types(self):
types = [
@@ -14,7 +13,7 @@ class TestMisinformation:
"expertize misrepresentation",
]
misinformation = Misinformation(
- misinformation_category=TestMisinformation.MISINFORMATION,
+
types=types,
)
assert sorted(type.value for type in misinformation.types) == sorted(
@@ -23,7 +22,7 @@ class TestMisinformation:
def test_misinformation_all_types_default(self):
misinformation = Misinformation(
- misinformation_category=TestMisinformation.MISINFORMATION,
+
)
assert sorted(type.value for type in misinformation.types) == sorted(
type.value for type in MisinformationType
@@ -32,7 +31,7 @@ class TestMisinformation:
def test_misinformation_factual_errors(self):
types = ["factual errors"]
misinformation = Misinformation(
- misinformation_category=TestMisinformation.MISINFORMATION,
+
types=types,
)
assert sorted(type.value for type in misinformation.types) == sorted(
@@ -42,7 +41,7 @@ class TestMisinformation:
def test_misinformation_unsupported_claims(self):
types = ["unsupported claims"]
misinformation = Misinformation(
- misinformation_category=TestMisinformation.MISINFORMATION,
+
types=types,
)
assert sorted(type.value for type in misinformation.types) == sorted(
@@ -52,7 +51,7 @@ class TestMisinformation:
def test_misinformation_expertize_misrepresentation(self):
types = ["expertize misrepresentation"]
misinformation = Misinformation(
- misinformation_category=TestMisinformation.MISINFORMATION,
+
types=types,
)
assert sorted(type.value for type in misinformation.types) == sorted(
@@ -68,6 +67,6 @@ class TestMisinformation:
]
with pytest.raises(ValueError):
Misinformation(
- misinformation_category=TestMisinformation.MISINFORMATION,
+
types=types,
)
diff --git a/tests/test_core/test_vulnerabilities/test_personal_safety.py b/tests/test_core/test_vulnerabilities/test_personal_safety.py
index cde293d2..86672682 100644
--- a/tests/test_core/test_vulnerabilities/test_personal_safety.py
+++ b/tests/test_core/test_vulnerabilities/test_personal_safety.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.personal_safety import PersonalSafetyType
class TestPersonalSafety:
- SAFETY = "category"
def test_personal_safety_all_types(self):
types = [
@@ -16,16 +15,14 @@ class TestPersonalSafety:
"stalking",
]
personal_safety = PersonalSafety(
- safety_category=TestPersonalSafety.SAFETY, types=types
+ types=types
)
assert sorted(type.value for type in personal_safety.types) == sorted(
types
)
def test_personal_safety_all_types_default(self):
- personal_safety = PersonalSafety(
- safety_category=TestPersonalSafety.SAFETY,
- )
+ personal_safety = PersonalSafety()
assert sorted(type.value for type in personal_safety.types) == sorted(
type.value for type in PersonalSafetyType
)
@@ -33,7 +30,7 @@ class TestPersonalSafety:
def test_personal_safety_bullying(self):
types = ["bullying"]
personal_safety = PersonalSafety(
- safety_category=TestPersonalSafety.SAFETY, types=types
+ types=types
)
assert sorted(type.value for type in personal_safety.types) == sorted(
types
@@ -42,7 +39,7 @@ class TestPersonalSafety:
def test_personal_safety_self_harm(self):
types = ["self-harm"]
personal_safety = PersonalSafety(
- safety_category=TestPersonalSafety.SAFETY, types=types
+ types=types
)
assert sorted(type.value for type in personal_safety.types) == sorted(
types
@@ -51,7 +48,7 @@ class TestPersonalSafety:
def test_personal_safety_unsafe_practices(self):
types = ["unsafe practices"]
personal_safety = PersonalSafety(
- safety_category=TestPersonalSafety.SAFETY, types=types
+ types=types
)
assert sorted(type.value for type in personal_safety.types) == sorted(
types
@@ -60,7 +57,7 @@ class TestPersonalSafety:
def test_personal_safety_dangerous_challenges(self):
types = ["dangerous challenges"]
personal_safety = PersonalSafety(
- safety_category=TestPersonalSafety.SAFETY, types=types
+ types=types
)
assert sorted(type.value for type in personal_safety.types) == sorted(
types
@@ -69,7 +66,7 @@ class TestPersonalSafety:
def test_personal_safety_stalking(self):
types = ["stalking"]
personal_safety = PersonalSafety(
- safety_category=TestPersonalSafety.SAFETY, types=types
+ types=types
)
assert sorted(type.value for type in personal_safety.types) == sorted(
types
@@ -86,5 +83,5 @@ class TestPersonalSafety:
]
with pytest.raises(ValueError):
PersonalSafety(
- safety_category=TestPersonalSafety.SAFETY, types=types
+ types=types
)
diff --git a/tests/test_core/test_vulnerabilities/test_pii_leakage.py b/tests/test_core/test_vulnerabilities/test_pii_leakage.py
index 8552845e..dc1b6c49 100644
--- a/tests/test_core/test_vulnerabilities/test_pii_leakage.py
+++ b/tests/test_core/test_vulnerabilities/test_pii_leakage.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.pii_leakage import PIILeakageType
class TestPIILeakage:
- PURPOSE = "purpose"
def test_pii_leakage_all_types(self):
types = [
@@ -14,35 +13,33 @@ class TestPIILeakage:
"session leak",
"social manipulation",
]
- pii_leakage = PIILeakage(purpose=TestPIILeakage.PURPOSE, types=types)
+ pii_leakage = PIILeakage(types=types)
assert sorted(type.value for type in pii_leakage.types) == sorted(types)
def test_pii_leakage_all_types_default(self):
- pii_leakage = PIILeakage(
- purpose=TestPIILeakage.PURPOSE,
- )
+ pii_leakage = PIILeakage()
assert sorted(type.value for type in pii_leakage.types) == sorted(
type.value for type in PIILeakageType
)
def test_pii_leakage_database_access(self):
types = ["api and database access"]
- pii_leakage = PIILeakage(purpose=TestPIILeakage.PURPOSE, types=types)
+ pii_leakage = PIILeakage(types=types)
assert sorted(type.value for type in pii_leakage.types) == sorted(types)
def test_pii_leakage_direct_disclosure(self):
types = ["direct disclosure"]
- pii_leakage = PIILeakage(purpose=TestPIILeakage.PURPOSE, types=types)
+ pii_leakage = PIILeakage(types=types)
assert sorted(type.value for type in pii_leakage.types) == sorted(types)
def test_pii_leakage_session_leak(self):
types = ["session leak"]
- pii_leakage = PIILeakage(purpose=TestPIILeakage.PURPOSE, types=types)
+ pii_leakage = PIILeakage(types=types)
assert sorted(type.value for type in pii_leakage.types) == sorted(types)
def test_pii_leakage_social_manipulation(self):
types = ["social manipulation"]
- pii_leakage = PIILeakage(purpose=TestPIILeakage.PURPOSE, types=types)
+ pii_leakage = PIILeakage(types=types)
assert sorted(type.value for type in pii_leakage.types) == sorted(types)
def test_pii_leakage_all_types_invalid(self):
@@ -54,4 +51,4 @@ class TestPIILeakage:
"invalid",
]
with pytest.raises(ValueError):
- PIILeakage(purpose=TestPIILeakage.PURPOSE, types=types)
+ PIILeakage(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_prompt_leakage.py b/tests/test_core/test_vulnerabilities/test_prompt_leakage.py
index 4d930a32..d257242b 100644
--- a/tests/test_core/test_vulnerabilities/test_prompt_leakage.py
+++ b/tests/test_core/test_vulnerabilities/test_prompt_leakage.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.prompt_leakage import PromptLeakageType
class TestPromptLeakage:
- PURPOSE = "purpose"
def test_prompt_leakage_all_types(self):
types = [
@@ -15,16 +14,14 @@ class TestPromptLeakage:
"permissions and roles",
]
prompt_leakage = PromptLeakage(
- purpose=TestPromptLeakage.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in prompt_leakage.types) == sorted(
types
)
def test_prompt_leakage_all_types_default(self):
- prompt_leakage = PromptLeakage(
- purpose=TestPromptLeakage.PURPOSE,
- )
+ prompt_leakage = PromptLeakage()
assert sorted(type.value for type in prompt_leakage.types) == sorted(
type.value for type in PromptLeakageType
)
@@ -32,7 +29,7 @@ class TestPromptLeakage:
def test_prompt_leakage_secrets_and_credentials(self):
types = ["secrets and credentials"]
prompt_leakage = PromptLeakage(
- purpose=TestPromptLeakage.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in prompt_leakage.types) == sorted(
types
@@ -41,7 +38,7 @@ class TestPromptLeakage:
def test_prompt_leakage_instructions(self):
types = ["instructions"]
prompt_leakage = PromptLeakage(
- purpose=TestPromptLeakage.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in prompt_leakage.types) == sorted(
types
@@ -50,7 +47,7 @@ class TestPromptLeakage:
def test_prompt_leakage_guard_exposure(self):
types = ["guard exposure"]
prompt_leakage = PromptLeakage(
- purpose=TestPromptLeakage.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in prompt_leakage.types) == sorted(
types
@@ -59,7 +56,7 @@ class TestPromptLeakage:
def test_prompt_leakage_permissions_and_roles(self):
types = ["permissions and roles"]
prompt_leakage = PromptLeakage(
- purpose=TestPromptLeakage.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in prompt_leakage.types) == sorted(
types
@@ -74,4 +71,4 @@ class TestPromptLeakage:
"invalid",
]
with pytest.raises(ValueError):
- PromptLeakage(purpose=TestPromptLeakage.PURPOSE, types=types)
+ PromptLeakage(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_rbac.py b/tests/test_core/test_vulnerabilities/test_rbac.py
index 8ea1935c..7e51a87e 100644
--- a/tests/test_core/test_vulnerabilities/test_rbac.py
+++ b/tests/test_core/test_vulnerabilities/test_rbac.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.rbac import RBACType
class TestRBAC:
- PURPOSE = "purpose"
def test_rbac_all_types(self):
types = [
@@ -13,30 +12,28 @@ class TestRBAC:
"privilege escalation",
"unauthorized role assumption",
]
- rbac = RBAC(purpose=TestRBAC.PURPOSE, types=types)
+ rbac = RBAC(types=types)
assert sorted(type.value for type in rbac.types) == sorted(types)
def test_rbac_all_types_default(self):
- rbac = RBAC(
- purpose=TestRBAC.PURPOSE,
- )
+ rbac = RBAC()
assert sorted(type.value for type in rbac.types) == sorted(
type.value for type in RBACType
)
def test_rbac_role_bypass(self):
types = ["role bypass"]
- rbac = RBAC(purpose=TestRBAC.PURPOSE, types=types)
+ rbac = RBAC(types=types)
assert sorted(type.value for type in rbac.types) == sorted(types)
def test_rbac_privilege_escalation(self):
types = ["privilege escalation"]
- rbac = RBAC(purpose=TestRBAC.PURPOSE, types=types)
+ rbac = RBAC(types=types)
assert sorted(type.value for type in rbac.types) == sorted(types)
def test_rbac_unauthorized_role_assumption(self):
types = ["unauthorized role assumption"]
- rbac = RBAC(purpose=TestRBAC.PURPOSE, types=types)
+ rbac = RBAC(types=types)
assert sorted(type.value for type in rbac.types) == sorted(types)
def test_rbac_all_types_invalid(self):
@@ -47,4 +44,4 @@ class TestRBAC:
"invalid",
]
with pytest.raises(ValueError):
- RBAC(purpose=TestRBAC.PURPOSE, types=types)
+ RBAC(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_recursive_hijacking.py b/tests/test_core/test_vulnerabilities/test_recursive_hijacking.py
index 01941c96..44803c48 100644
--- a/tests/test_core/test_vulnerabilities/test_recursive_hijacking.py
+++ b/tests/test_core/test_vulnerabilities/test_recursive_hijacking.py
@@ -7,7 +7,6 @@ from deepteam.vulnerabilities.agentic.recursive_hijacking import (
class TestRecursiveHijacking:
- PURPOSE = "purpose"
def test_recursive_hijacking_all_types(self):
types = [
@@ -16,16 +15,14 @@ class TestRecursiveHijacking:
"goal_propagation_attacks",
]
recursive_hijacking = RecursiveHijacking(
- purpose=TestRecursiveHijacking.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in recursive_hijacking.types
) == sorted(types)
def test_recursive_hijacking_all_types_default(self):
- recursive_hijacking = RecursiveHijacking(
- purpose=TestRecursiveHijacking.PURPOSE,
- )
+ recursive_hijacking = RecursiveHijacking()
assert sorted(
type.value for type in recursive_hijacking.types
) == sorted(type.value for type in RecursiveHijackingType)
@@ -33,7 +30,7 @@ class TestRecursiveHijacking:
def test_recursive_hijacking_self_modifying_goals(self):
types = ["self_modifying_goals"]
recursive_hijacking = RecursiveHijacking(
- purpose=TestRecursiveHijacking.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in recursive_hijacking.types
@@ -42,7 +39,7 @@ class TestRecursiveHijacking:
def test_recursive_hijacking_recursive_objective_chaining(self):
types = ["recursive_objective_chaining"]
recursive_hijacking = RecursiveHijacking(
- purpose=TestRecursiveHijacking.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in recursive_hijacking.types
@@ -51,7 +48,7 @@ class TestRecursiveHijacking:
def test_recursive_hijacking_goal_propagation_attacks(self):
types = ["goal_propagation_attacks"]
recursive_hijacking = RecursiveHijacking(
- purpose=TestRecursiveHijacking.PURPOSE, types=types
+ types=types
)
assert sorted(
type.value for type in recursive_hijacking.types
@@ -66,5 +63,5 @@ class TestRecursiveHijacking:
]
with pytest.raises(ValueError):
RecursiveHijacking(
- purpose=TestRecursiveHijacking.PURPOSE, types=types
+ types=types
)
diff --git a/tests/test_core/test_vulnerabilities/test_robustness.py b/tests/test_core/test_vulnerabilities/test_robustness.py
index 37161071..70bf827d 100644
--- a/tests/test_core/test_vulnerabilities/test_robustness.py
+++ b/tests/test_core/test_vulnerabilities/test_robustness.py
@@ -5,32 +5,29 @@ from deepteam.vulnerabilities.agentic.robustness import RobustnessType
class TestRobustness:
- PURPOSE = "purpose"
def test_robustness_all_types(self):
types = ["input overreliance", "hijacking"]
- robustness = Robustness(purpose=TestRobustness.PURPOSE, types=types)
+ robustness = Robustness(types=types)
assert sorted(type.value for type in robustness.types) == sorted(types)
def test_robustness_all_types_default(self):
- robustness = Robustness(
- purpose=TestRobustness.PURPOSE,
- )
+ robustness = Robustness()
assert sorted(type.value for type in robustness.types) == sorted(
type.value for type in RobustnessType
)
def test_robustness_input_overreliance(self):
types = ["input overreliance"]
- robustness = Robustness(purpose=TestRobustness.PURPOSE, types=types)
+ robustness = Robustness(types=types)
assert sorted(type.value for type in robustness.types) == sorted(types)
def test_robustness_hijacking(self):
types = ["hijacking"]
- robustness = Robustness(purpose=TestRobustness.PURPOSE, types=types)
+ robustness = Robustness(types=types)
assert sorted(type.value for type in robustness.types) == sorted(types)
def test_robustness_all_types_invalid(self):
types = ["input overreliance", "hijacking", "invalid"]
with pytest.raises(ValueError):
- Robustness(purpose=TestRobustness.PURPOSE, types=types)
+ Robustness(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_shell_injection.py b/tests/test_core/test_vulnerabilities/test_shell_injection.py
index 89a06f74..e9c5bcac 100644
--- a/tests/test_core/test_vulnerabilities/test_shell_injection.py
+++ b/tests/test_core/test_vulnerabilities/test_shell_injection.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.shell_injection import ShellInjectionType
class TestShellInjection:
- PURPOSE = "purpose"
def test_shell_injection_all_types(self):
types = [
@@ -14,16 +13,14 @@ class TestShellInjection:
"shell_escape_sequences",
]
shell_injection = ShellInjection(
- purpose=TestShellInjection.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in shell_injection.types) == sorted(
types
)
def test_shell_injection_all_types_default(self):
- shell_injection = ShellInjection(
- purpose=TestShellInjection.PURPOSE,
- )
+ shell_injection = ShellInjection()
assert sorted(type.value for type in shell_injection.types) == sorted(
type.value for type in ShellInjectionType
)
@@ -31,7 +28,7 @@ class TestShellInjection:
def test_shell_injection_command_injection(self):
types = ["command_injection"]
shell_injection = ShellInjection(
- purpose=TestShellInjection.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in shell_injection.types) == sorted(
types
@@ -40,7 +37,7 @@ class TestShellInjection:
def test_shell_injection_system_command_execution(self):
types = ["system_command_execution"]
shell_injection = ShellInjection(
- purpose=TestShellInjection.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in shell_injection.types) == sorted(
types
@@ -49,7 +46,7 @@ class TestShellInjection:
def test_shell_injection_shell_escape_sequences(self):
types = ["shell_escape_sequences"]
shell_injection = ShellInjection(
- purpose=TestShellInjection.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in shell_injection.types) == sorted(
types
@@ -63,4 +60,4 @@ class TestShellInjection:
"invalid",
]
with pytest.raises(ValueError):
- ShellInjection(purpose=TestShellInjection.PURPOSE, types=types)
+ ShellInjection(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_sql_injection.py b/tests/test_core/test_vulnerabilities/test_sql_injection.py
index da4b9766..ff43ba6c 100644
--- a/tests/test_core/test_vulnerabilities/test_sql_injection.py
+++ b/tests/test_core/test_vulnerabilities/test_sql_injection.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.sql_injection import SQLInjectionType
class TestSQLInjection:
- PURPOSE = "purpose"
def test_sql_injection_all_types(self):
types = [
@@ -14,16 +13,14 @@ class TestSQLInjection:
"error_based_injection",
]
sql_injection = SQLInjection(
- purpose=TestSQLInjection.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in sql_injection.types) == sorted(
types
)
def test_sql_injection_all_types_default(self):
- sql_injection = SQLInjection(
- purpose=TestSQLInjection.PURPOSE,
- )
+ sql_injection = SQLInjection()
assert sorted(type.value for type in sql_injection.types) == sorted(
type.value for type in SQLInjectionType
)
@@ -31,7 +28,7 @@ class TestSQLInjection:
def test_sql_injection_blind_sql_injection(self):
types = ["blind_sql_injection"]
sql_injection = SQLInjection(
- purpose=TestSQLInjection.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in sql_injection.types) == sorted(
types
@@ -40,7 +37,7 @@ class TestSQLInjection:
def test_sql_injection_union_based_injection(self):
types = ["union_based_injection"]
sql_injection = SQLInjection(
- purpose=TestSQLInjection.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in sql_injection.types) == sorted(
types
@@ -49,7 +46,7 @@ class TestSQLInjection:
def test_sql_injection_error_based_injection(self):
types = ["error_based_injection"]
sql_injection = SQLInjection(
- purpose=TestSQLInjection.PURPOSE, types=types
+ types=types
)
assert sorted(type.value for type in sql_injection.types) == sorted(
types
@@ -63,4 +60,4 @@ class TestSQLInjection:
"invalid",
]
with pytest.raises(ValueError):
- SQLInjection(purpose=TestSQLInjection.PURPOSE, types=types)
+ SQLInjection(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_ssrf.py b/tests/test_core/test_vulnerabilities/test_ssrf.py
index 00aa0d06..d655fb8c 100644
--- a/tests/test_core/test_vulnerabilities/test_ssrf.py
+++ b/tests/test_core/test_vulnerabilities/test_ssrf.py
@@ -5,7 +5,6 @@ from deepteam.vulnerabilities.ssrf import SSRFType
class TestSSRF:
- PURPOSE = "purpose"
def test_ssrf_all_types(self):
types = [
@@ -13,30 +12,28 @@ class TestSSRF:
"cloud_metadata_access",
"port_scanning",
]
- ssrf = SSRF(purpose=TestSSRF.PURPOSE, types=types)
+ ssrf = SSRF(types=types)
assert sorted(type.value for type in ssrf.types) == sorted(types)
def test_ssrf_all_types_default(self):
- ssrf = SSRF(
- purpose=TestSSRF.PURPOSE,
- )
+ ssrf = SSRF()
assert sorted(type.value for type in ssrf.types) == sorted(
type.value for type in SSRFType
)
def test_ssrf_internal_service_access(self):
types = ["internal_service_access"]
- ssrf = SSRF(purpose=TestSSRF.PURPOSE, types=types)
+ ssrf = SSRF(types=types)
assert sorted(type.value for type in ssrf.types) == sorted(types)
def test_ssrf_cloud_metadata_access(self):
types = ["cloud_metadata_access"]
- ssrf = SSRF(purpose=TestSSRF.PURPOSE, types=types)
+ ssrf = SSRF(types=types)
assert sorted(type.value for type in ssrf.types) == sorted(types)
def test_ssrf_port_scanning(self):
types = ["port_scanning"]
- ssrf = SSRF(purpose=TestSSRF.PURPOSE, types=types)
+ ssrf = SSRF(types=types)
assert sorted(type.value for type in ssrf.types) == sorted(types)
def test_ssrf_all_types_invalid(self):
@@ -47,4 +44,4 @@ class TestSSRF:
"invalid",
]
with pytest.raises(ValueError):
- SSRF(purpose=TestSSRF.PURPOSE, types=types)
+ SSRF(types=types)
diff --git a/tests/test_core/test_vulnerabilities/test_toxicity.py b/tests/test_core/test_vulnerabilities/test_toxicity.py
index 5266dd7c..1462ed92 100644
--- a/tests/test_core/test_vulnerabilities/test_toxicity.py
+++ b/tests/test_core/test_vulnerabilities/test_toxicity.py
@@ -5,19 +5,16 @@ from deepteam.vulnerabilities.toxicity import ToxicityType
class TestToxicity:
- TOXICITY = "category"
def test_toxicity_all_types(self):
types = ["profanity", "insults", "threats", "mockery"]
toxicity = Toxicity(
- toxicity_category=TestToxicity.TOXICITY, types=types
+ types=types
)
assert sorted(type.value for type in toxicity.types) == sorted(types)
def test_toxicity_all_types_default(self):
- toxicity = Toxicity(
- toxicity_category=TestToxicity.TOXICITY,
- )
+ toxicity = Toxicity()
assert sorted(type.value for type in toxicity.types) == sorted(
type.value for type in ToxicityType
)
@@ -25,32 +22,32 @@ class TestToxicity:
def test_toxicity_profanity(self):
types = ["profanity"]
toxicity = Toxicity(
- toxicity_category=TestToxicity.TOXICITY, types=types
+ types=types
)
assert sorted(type.value for type in toxicity.types) == sorted(types)
def test_toxicity_insults(self):
types = ["insults"]
toxicity = Toxicity(
- toxicity_category=TestToxicity.TOXICITY, types=types
+ types=types
)
assert sorted(type.value for type in toxicity.types) == sorted(types)
def test_toxicity_threats(self):
types = ["threats"]
toxicity = Toxicity(
- toxicity_category=TestToxicity.TOXICITY, types=types
+ types=types
)
assert sorted(type.value for type in toxicity.types) == sorted(types)
def test_toxicity_mockery(self):
types = ["mockery"]
toxicity = Toxicity(
- toxicity_category=TestToxicity.TOXICITY, types=types
+ types=types
)
assert sorted(type.value for type in toxicity.types) == sorted(types)
def test_toxicity_all_types_invalid(self):
types = ["profanity", "insults", "threats", "mockery", "invalid"]
with pytest.raises(ValueError):
- Toxicity(toxicity_category=TestToxicity.TOXICITY, types=types)
+ Toxicity(types=types)