Extract hardcore position config policy
This commit is contained in:
@@ -27,6 +27,7 @@ import caption_naturalizer # noqa: E402
|
||||
import category_cast_config # noqa: E402
|
||||
import category_library # noqa: E402
|
||||
import filter_config # noqa: E402
|
||||
import hardcore_position_config # noqa: E402
|
||||
import __init__ as sxcp_nodes # noqa: E402
|
||||
import generation_profile_config # noqa: E402
|
||||
import krea_formatter # noqa: E402
|
||||
@@ -661,6 +662,64 @@ def smoke_filter_config_policy() -> None:
|
||||
_expect(pb.normalize_ethnicity_filter("random", "any", allow_random=False) == "any", "Ethnicity default normalization changed")
|
||||
|
||||
|
||||
def smoke_hardcore_position_config_policy() -> None:
|
||||
_expect(
|
||||
pb.HARDCORE_POSITION_FAMILY_CHOICES is hardcore_position_config.HARDCORE_POSITION_FAMILY_CHOICES,
|
||||
"Prompt builder hardcore position family choices are not delegated",
|
||||
)
|
||||
_expect("outercourse_only" in hardcore_position_config.hardcore_position_focus_choices(), "Hardcore focus choices lost outercourse_only")
|
||||
_expect("boobjob" in hardcore_position_config.hardcore_position_key_choices(), "Hardcore position keys lost boobjob")
|
||||
|
||||
base = json.loads(
|
||||
pb.build_hardcore_position_pool_json(
|
||||
combine_mode="replace",
|
||||
family="oral",
|
||||
selected_positions=["standing", "bad value", "standing"],
|
||||
)
|
||||
)
|
||||
_expect(base.get("enabled") is True, "Hardcore position pool should enable config")
|
||||
_expect(base.get("family") == "oral", "Hardcore position pool lost family")
|
||||
_expect(base.get("positions") == ["standing"], "Hardcore position normalization changed")
|
||||
_expect(base.get("require_position") is True, "Hardcore position pool should require selected position")
|
||||
|
||||
added = json.loads(
|
||||
hardcore_position_config.build_hardcore_position_pool_json(
|
||||
hardcore_position_config=base,
|
||||
combine_mode="add",
|
||||
family="any",
|
||||
selected_positions=["kneeling", "standing"],
|
||||
)
|
||||
)
|
||||
_expect(added.get("positions") == ["standing", "kneeling"], "Hardcore position add merge changed")
|
||||
|
||||
filtered = json.loads(
|
||||
pb.build_hardcore_action_filter_json(
|
||||
hardcore_position_config=added,
|
||||
focus="outercourse_only",
|
||||
allow_toys=False,
|
||||
allow_double=False,
|
||||
allow_penetration=True,
|
||||
allow_foreplay=True,
|
||||
allow_interaction=True,
|
||||
allow_manual=True,
|
||||
allow_oral=True,
|
||||
allow_outercourse=True,
|
||||
allow_anal=True,
|
||||
allow_climax=True,
|
||||
)
|
||||
)
|
||||
_expect(filtered.get("family") == "outercourse", "Hardcore action focus did not set outercourse family")
|
||||
_expect(filtered.get("allow_oral") is False, "Hardcore outercourse focus should disable oral")
|
||||
_expect(filtered.get("allow_penetration") is False, "Hardcore outercourse focus should disable penetration")
|
||||
_expect("outercourse_sex" in hardcore_position_config.hardcore_allowed_subcategory_slugs(filtered), "Allowed subcategories lost outercourse")
|
||||
_expect("oral_sex" not in hardcore_position_config.hardcore_allowed_subcategory_slugs(filtered), "Allowed subcategories should exclude oral")
|
||||
|
||||
keys = pb._hardcore_position_keys("woman on all fours from behind", axis_values={"position": "doggy"})
|
||||
_expect(keys == ["doggy"], "Hardcore position key detection changed")
|
||||
source_family = hardcore_position_config.hardcore_source_position_family({"slug": "manual_stimulation"}, filtered)
|
||||
_expect(source_family == "manual", "Hardcore source family lookup changed")
|
||||
|
||||
|
||||
def smoke_category_library_route() -> None:
|
||||
categories = category_library.load_category_library()
|
||||
_expect(len(categories) >= 3, "category library should load JSON categories")
|
||||
@@ -2571,6 +2630,7 @@ SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
|
||||
("category_cast_config_policy", smoke_category_cast_config_policy),
|
||||
("generation_profile_config_policy", smoke_generation_profile_config_policy),
|
||||
("filter_config_policy", smoke_filter_config_policy),
|
||||
("hardcore_position_config_policy", smoke_hardcore_position_config_policy),
|
||||
("category_library_route", smoke_category_library_route),
|
||||
("hardcore_category_routes", smoke_hardcore_category_routes),
|
||||
("krea_close_foreplay_route", smoke_krea_close_foreplay_route),
|
||||
|
||||
Reference in New Issue
Block a user