Use item axis details in captions
This commit is contained in:
@@ -4104,11 +4104,30 @@ def smoke_caption_text_policy() -> None:
|
||||
== caption_text_policy.with_trigger("A caption body", Trigger, True),
|
||||
"Caption trigger wrapper should delegate to caption_text_policy",
|
||||
)
|
||||
axis_detail_row = {
|
||||
"item_axis_values": {
|
||||
"position": "standing oral position",
|
||||
"contact_detail": "mouth contact at hip height",
|
||||
"duplicate": "standing oral position",
|
||||
"ignored": "random",
|
||||
}
|
||||
}
|
||||
_expect(
|
||||
caption_text_policy.item_axis_detail_text(axis_detail_row, "generic action")
|
||||
== "standing oral position and mouth contact at hip height",
|
||||
"Caption axis detail text should flatten selected item axes",
|
||||
)
|
||||
_expect(
|
||||
caption_text_policy.item_axis_detail_text(axis_detail_row, "standing oral position already appears")
|
||||
== "mouth contact at hip height",
|
||||
"Caption axis detail text should skip details already present in item prose",
|
||||
)
|
||||
deps = caption_naturalizer._caption_metadata_route_dependencies()
|
||||
_expect(deps.clean_text is caption_text_policy.clean_text, "Caption route deps lost clean text policy")
|
||||
_expect(deps.field_row_value is caption_text_policy.field_row_value, "Caption route deps lost field row-value policy")
|
||||
_expect(deps.expression_disabled is caption_text_policy.expression_disabled, "Caption route deps lost expression policy")
|
||||
_expect(deps.single_caption_front is caption_text_policy.single_caption_front, "Caption route deps lost front parser")
|
||||
_expect(deps.item_axis_detail_text is caption_text_policy.item_axis_detail_text, "Caption route deps lost item-axis detail policy")
|
||||
_expect(deps.metadata_to_prose is caption_naturalizer._metadata_to_prose, "Caption route deps lost metadata recursion callback")
|
||||
|
||||
|
||||
@@ -4185,6 +4204,29 @@ def smoke_caption_metadata_routes() -> None:
|
||||
caption_naturalizer._configured_cast_from_row,
|
||||
"metadata(configured_cast)",
|
||||
)
|
||||
configured_axis_only = _fixture_hardcore_row(
|
||||
item="generic configured adult action",
|
||||
role_graph="",
|
||||
source_role_graph="",
|
||||
item_axis_values={
|
||||
"position": "standing oral position",
|
||||
"contact_detail": "mouth contact at hip height, hands on hips",
|
||||
},
|
||||
action_family="oral",
|
||||
position_family="oral",
|
||||
position_key="standing",
|
||||
position_keys=["standing"],
|
||||
)
|
||||
axis_route = caption_metadata_routes.configured_cast_from_row_result(
|
||||
caption_naturalizer._caption_metadata_route_request(configured_axis_only, "balanced", False),
|
||||
caption_naturalizer._caption_metadata_route_dependencies(),
|
||||
)
|
||||
_expect(axis_route is not None, "Caption configured-cast axis-only row did not match")
|
||||
assert axis_route is not None
|
||||
_expect("Selected action details include" in axis_route.prose, "Caption route did not emit selected axis details")
|
||||
_expect("standing oral position" in axis_route.prose, "Caption route lost item-axis position detail")
|
||||
_expect("mouth contact at hip height" in axis_route.prose, "Caption route lost item-axis contact detail")
|
||||
_expect("hands on hips" in axis_route.prose, "Caption route lost item-axis split detail")
|
||||
|
||||
group = {
|
||||
"primary_subject": "group scene",
|
||||
|
||||
Reference in New Issue
Block a user