Cover config prompt route in smoke tests
This commit is contained in:
@@ -192,6 +192,15 @@ def _coworking_location_config() -> str:
|
||||
)
|
||||
|
||||
|
||||
def _classical_library_theme_configs() -> tuple[str, str]:
|
||||
location_config, composition_config, _summary = pb.build_thematic_location_json(
|
||||
enabled=True,
|
||||
combine_mode="replace",
|
||||
theme="classical_library",
|
||||
)
|
||||
return location_config, composition_config
|
||||
|
||||
|
||||
def _orbit_camera(
|
||||
*,
|
||||
horizontal_angle: int,
|
||||
@@ -299,6 +308,59 @@ def smoke_camera_scene_single() -> None:
|
||||
_expect_formatter_outputs(row, "camera_scene_single", target="single")
|
||||
|
||||
|
||||
def smoke_config_route_location_theme() -> None:
|
||||
location_config, composition_config = _classical_library_theme_configs()
|
||||
row = pb.build_prompt_from_configs(
|
||||
row_number=1,
|
||||
start_index=1,
|
||||
seed=3301,
|
||||
category_config=pb.build_category_config_json("hardcore_pose", "Foreplay and teasing"),
|
||||
cast_config=pb.build_cast_config_json("mixed_couple"),
|
||||
generation_profile=pb.build_generation_profile_json(
|
||||
profile="hardcore_intense",
|
||||
trigger_policy="prepend_trigger",
|
||||
),
|
||||
filter_config=pb.build_ethnicity_list_json(
|
||||
include_french_european=True,
|
||||
strict_excludes=True,
|
||||
)["filter_config"],
|
||||
seed_config=pb.build_seed_lock_config_json(
|
||||
base_seed=3301,
|
||||
reroll_axis="pose",
|
||||
reroll_seed=3302,
|
||||
),
|
||||
camera_config=_orbit_camera(
|
||||
horizontal_angle=315,
|
||||
vertical_angle=0,
|
||||
zoom=5.0,
|
||||
subject_focus="action",
|
||||
),
|
||||
character_cast=_character_cast(),
|
||||
hardcore_position_config=_action_filter("foreplay_only"),
|
||||
location_config=location_config,
|
||||
composition_config=composition_config,
|
||||
)
|
||||
_expect_custom_row(row, "config_route_location_theme")
|
||||
_expect(row.get("subcategory") == "Foreplay and teasing", "config route did not preserve requested subcategory")
|
||||
_expect(row.get("subject_type") == "configured_cast", "config route did not apply character cast")
|
||||
scene = _expect_text("config_route_location_theme.scene_text", row.get("scene_text"), 20)
|
||||
composition = _expect_text("config_route_location_theme.composition", row.get("composition"), 10)
|
||||
camera = _expect_text("config_route_location_theme.camera_directive", row.get("camera_directive"), 20)
|
||||
_expect("library" in scene.lower() or "bookshelves" in scene.lower(), "location theme did not drive scene")
|
||||
_expect("books" in composition.lower() or "shelf" in composition.lower() or "library" in composition.lower(), "location theme did not drive composition")
|
||||
_expect("315-degree front-left quarter view" in camera, "config route did not preserve orbit camera directive")
|
||||
seed_config = row.get("seed_config") if isinstance(row.get("seed_config"), dict) else {}
|
||||
_expect(seed_config.get("pose_seed") == 3302, "seed lock did not reroll pose axis")
|
||||
_expect(seed_config.get("role_seed") == 3302, "seed lock did not reroll role axis")
|
||||
_expect(row.get("trigger") == "sxcpinup_coloredpencil", "generation profile trigger did not apply")
|
||||
_expect_trigger_once("config_route_location_theme.prompt", row.get("prompt"), "sxcpinup_coloredpencil")
|
||||
krea = krea_formatter.format_krea2_prompt("", metadata_json=_json(row), target="single")
|
||||
prompt = krea.get("krea_prompt") or ""
|
||||
_expect("library" in prompt.lower() or "bookshelves" in prompt.lower(), "Krea config route lost theme scene")
|
||||
_expect("315-degree front-left quarter view" in prompt, "Krea config route lost camera directive")
|
||||
_expect_formatter_outputs(row, "config_route_location_theme", target="single")
|
||||
|
||||
|
||||
def smoke_hardcore_category_routes() -> None:
|
||||
cast = _character_cast()
|
||||
cases = [
|
||||
@@ -520,6 +582,7 @@ def smoke_no_expression_fallback() -> None:
|
||||
SMOKE_CASES: list[tuple[str, Callable[[], None]]] = [
|
||||
("builtin_single_woman", smoke_builtin_single),
|
||||
("camera_scene_single", smoke_camera_scene_single),
|
||||
("config_route_location_theme", smoke_config_route_location_theme),
|
||||
("hardcore_category_routes", smoke_hardcore_category_routes),
|
||||
("insta_pair_same_cast", smoke_insta_pair),
|
||||
("insta_pair_pov_man", smoke_insta_pair_pov),
|
||||
|
||||
Reference in New Issue
Block a user