Centralize item axis value flattening
This commit is contained in:
@@ -50,6 +50,7 @@ import __init__ as sxcp_nodes # noqa: E402
|
||||
import generation_profile_config # noqa: E402
|
||||
import hardcore_role_outercourse # noqa: E402
|
||||
import index_switch_policy # noqa: E402
|
||||
import item_axis_policy # noqa: E402
|
||||
import node_tooltips # noqa: E402
|
||||
import krea_cast # noqa: E402
|
||||
import krea_action_details # noqa: E402
|
||||
@@ -1605,6 +1606,36 @@ def smoke_outercourse_action_policy() -> None:
|
||||
_expect("wet lips" in deduped, "Krea outercourse dedupe removed useful texture clause")
|
||||
|
||||
|
||||
def smoke_item_axis_policy() -> None:
|
||||
axis_values = {
|
||||
"ignored": "random",
|
||||
"position": "kneeling oral position",
|
||||
"contact_detail": {"text": "mouth contact at hip height"},
|
||||
"nested": {"unused": "fallback body detail"},
|
||||
"list_detail": ["hands on hips", "auto"],
|
||||
"unprioritized_detail": "extra unprioritized cue",
|
||||
}
|
||||
texts = item_axis_policy.axis_value_texts(axis_values)
|
||||
_expect("kneeling oral position" in texts, "Item axis policy lost position value")
|
||||
_expect("mouth contact at hip height" in texts, "Item axis policy lost preferred dict text")
|
||||
_expect("fallback body detail" in texts, "Item axis policy lost nested fallback text")
|
||||
_expect("hands on hips" in texts, "Item axis policy lost list text")
|
||||
_expect("random" not in texts and "auto" not in texts, "Item axis policy leaked placeholder values")
|
||||
_expect(
|
||||
item_axis_policy.axis_value_texts(axis_values, existing_text="kneeling oral position already present")[0]
|
||||
== "mouth contact at hip height",
|
||||
"Item axis policy should skip details already present in existing text",
|
||||
)
|
||||
context_text = item_axis_policy.action_context_text(axis_values)
|
||||
_expect("kneeling oral position" in context_text, "Item axis policy context lost priority position")
|
||||
_expect("mouth contact at hip height" in context_text, "Item axis policy context lost priority contact")
|
||||
_expect("extra unprioritized cue" not in context_text, "Item axis policy context should ignore unprioritized values")
|
||||
_expect(
|
||||
krea_action_context.axis_values_text(axis_values) == context_text,
|
||||
"Krea action context should delegate to shared item axis policy",
|
||||
)
|
||||
|
||||
|
||||
def smoke_krea_row_fields_policy() -> None:
|
||||
row = {
|
||||
"subject_type": "configured_cast",
|
||||
@@ -8472,6 +8503,7 @@ SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
|
||||
("krea_normal_row_routes", smoke_krea_normal_row_routes),
|
||||
("krea_action_details_policy", smoke_krea_action_details_policy),
|
||||
("outercourse_action_policy", smoke_outercourse_action_policy),
|
||||
("item_axis_policy", smoke_item_axis_policy),
|
||||
("krea_row_fields_policy", smoke_krea_row_fields_policy),
|
||||
("location_config_policy", smoke_location_config_policy),
|
||||
("row_location_policy", smoke_row_location_policy),
|
||||
|
||||
Reference in New Issue
Block a user