diff --git a/tests/_character_test_helpers.py b/tests/_character_test_helpers.py index e89802de..abb128d0 100644 --- a/tests/_character_test_helpers.py +++ b/tests/_character_test_helpers.py @@ -18,6 +18,11 @@ corresponding *real* production method can parse: import json +from talemate.agents.creator.character import ( + CHARACTER_GENERATION_ASPECTS, + CONSOLIDATE_TEMPLATES_FLAG, +) + # prompt kinds per real request path, for routing assertions against # MockClient.prompt_history (see the corresponding Prompt.request calls) KIND_NAME = "analyze_freeform_24" # creator.determine-character-name @@ -27,17 +32,8 @@ KIND_SHEET = "create" # world_state.extract-character-sheet KIND_FOCAL = "analyze_1024" # focal.request default response_length KIND_UNIFIED = "create_4096" # creator.generate-character @ default budget -# the character_creation "Consolidate" config default (for restoring after -# tests that widen or narrow the selection): every aspect, plus the -# 'Attribute templates' fold flag -DEFAULT_CONSOLIDATE = [ - "name", - "description", - "attributes", - "dialogue_instructions", - "example_dialogue", - "attribute_templates", -] +# the character_creation "Consolidate" config default +DEFAULT_CONSOLIDATE = list(CHARACTER_GENERATION_ASPECTS) + [CONSOLIDATE_TEMPLATES_FLAG] def prompt_kinds(client) -> list[str]: diff --git a/tests/test_creator_character.py b/tests/test_creator_character.py index 09a21f94..56297d92 100644 --- a/tests/test_creator_character.py +++ b/tests/test_creator_character.py @@ -33,6 +33,7 @@ from conftest import ( client_responses, ) from _character_test_helpers import ( + DEFAULT_CONSOLIDATE, KIND_DESCRIPTION, KIND_DIALOGUE_INSTRUCTIONS, KIND_NAME, @@ -466,6 +467,12 @@ async def test_generate_character_unified_example_dialogue_guidance_rendered(cre assert result.example_dialogue == ['Elena: "Oh dear!"'] +def test_consolidate_default(creator): + # the shipped setting must stay the derived "everything" composition - + # a hardcoded, narrowed or reordered value= fails here + assert creator.cc_consolidate == DEFAULT_CONSOLIDATE + + def test_consolidate_templates_default(creator): assert creator.cc_consolidate_templates is True