Honor metadata in hardcore filters

This commit is contained in:
2026-06-27 14:19:47 +02:00
parent 7bc08ada47
commit ec79257613
2 changed files with 98 additions and 14 deletions
+28 -5
View File
@@ -3735,28 +3735,51 @@ def smoke_hardcore_position_config_policy() -> None:
action_only,
)
_expect(action_axis == ["boobjob body contact"], "Hardcore action filter policy did not block disabled oral/penetration text")
action_axis_metadata = hardcore_position_config.filter_hardcore_axis(
"outer_act",
[
{"text": "generic contact route", "action_family": "outercourse", "position_family": "outercourse"},
{"text": "generic contact route", "action_family": "oral", "position_family": "oral"},
{"text": "generic contact route", "action_family": "penetration", "position_family": "penetrative"},
],
action_only,
)
_expect(
action_axis_metadata == [{"text": "generic contact route", "action_family": "outercourse", "position_family": "outercourse"}],
"Hardcore action filter policy did not honor structured action metadata",
)
position_filtered = hardcore_position_config.apply_hardcore_position_config_to_subcategory(
{
"slug": "oral_sex",
"item_templates": [
{"template": "oral contact in {position}"},
{"template": "metadata-specific oral contact", "position_key": "standing", "action_family": "oral"},
{"template": "oral sex without a position axis"},
{"template": "unsupported static template"},
],
"item_axes": {
"position": ["standing oral position", "kneeling oral position"],
"position": [
"standing oral position",
"kneeling oral position",
{"text": "generic standing pose", "position_key": "standing"},
{"text": "generic kneeling pose", "position_key": "kneeling"},
],
"oral_act": ["blowjob", "cunnilingus"],
},
},
base,
)
_expect(
position_filtered["item_templates"] == [{"template": "oral contact in {position}"}],
"Hardcore position policy did not filter templates by selected position requirements",
position_filtered["item_templates"]
== [
{"template": "oral contact in {position}"},
{"template": "metadata-specific oral contact", "position_key": "standing", "action_family": "oral"},
],
"Hardcore position policy did not filter templates by selected position requirements or metadata",
)
_expect(
position_filtered["item_axes"]["position"] == ["standing oral position"],
"Hardcore position policy did not filter position axes by selected keys",
position_filtered["item_axes"]["position"] == ["standing oral position", {"text": "generic standing pose", "position_key": "standing"}],
"Hardcore position policy did not filter position axes by selected keys or metadata",
)
filtered_categories = hardcore_position_config.filter_hardcore_categories_for_position(
[