Skip to content

Commit

Permalink
one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
neph1 committed Oct 20, 2024
1 parent 1a04e6c commit d8fc907
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_story_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from tale.llm.dynamic_story import DynamicStory
from tale.llm.llm_utils import LlmUtil
from tale.player import PlayerConnection
from tale.story import StoryConfig
from tale.story import StoryConfig, StoryContext
from tale.story_builder import StoryBuilder, StoryInfo
from tests.supportstuff import FakeIoUtil

Expand Down Expand Up @@ -74,7 +74,9 @@ def test_apply_to_story(self):
builder.story_info.world_mood = 3
builder.story_info.start_location = "on a small road outside a village"

responses = ['In the peaceful land of Whimsy, where the sun always shines bright and the creatures are forever young, a darkness has begun to stir beneath the surface. A great evil, born from the twisted imagination of the Mad Hatter, threatens to consume the entire realm. This malevolent force seeks to plunge Whimsy into eternal night, and all who oppose it must band together if they hope to save their home from destruction. The players\' village is the first to fall under attack, forcing them to embark on a perilous journey across this magical landscape to rally allies for the impending war against the shadowy foe. Along the way, they discover hidden secrets about the nature of their world and their own roles within its grand narrative, ultimately deciding the fate of an enchanted civilization hanging precariously upon their shoulders.',
story_background = "In the peaceful land of Whimsy, where the sun always shines bright and the creatures are forever young, a darkness has begun to stir beneath the surface. A great evil, born from the twisted imagination of the Mad Hatter, threatens to consume the entire realm. This malevolent force seeks to plunge Whimsy into eternal night, and all who oppose it must band together if they hope to save their home from destruction. The players\' village is the first to fall under attack, forcing them to embark on a perilous journey across this magical landscape to rally allies for the impending war against the shadowy foe. Along the way, they discover hidden secrets about the nature of their world and their own roles within its grand narrative, ultimately deciding the fate of an enchanted civilization hanging precariously upon their shoulders."

responses = [story_background,
'{"items":[{"name":"Enchanted Petals", "type":"Health", "value": 20, "description": "A handful of enchanted petals that can be used to heal wounds and cure ailments."}]}',
'{"creatures": [ { "name": "Whimsy Woozle", "description": "A gentle, ethereal creature with a penchant for gardening and poetry. They tend to the area\'s lush fields and forests, filling the air with sweet melodies and the scent of blooming wildflowers. They are friendly and welcoming to all visitors.", "level": 1 }, { "name": "Lunar Lopster", "description": "A mysterious crustacean with an affinity for the moon\'s gentle light. They roam the area at night, their glowing shells lighting the way through the darkness. They are neutral towards visitors, but may offer cryptic advice or guidance to those who seek it.", "level": 2 }, { "name": "Shadow Stag", "description": "A sleek and elusive creature with a mischievous grin. They roam the area\'s forests, their dark forms blending into the shadows. They are hostile towards intruders, and will not hesitate to attack those who threaten their home.", "level": 3 }, { "name": "Moonflower", "description": "A rare and beautiful flower that blooms only under the light of the full moon. They can be found in the area\'s forests, and are said to have powerful healing properties. They are very friendly towards visitors, and will offer their petals to those who show kindness and respect.", "level": 4 }, { "name": "Moonstone", "description": "A rare and valuable mineral that can be found in the area\'s mountains. It glows with a soft, ethereal light, and is said to have powerful magical properties. It is highly sought after by collectors, and can be found in both the earth and the water.", "level": 5 }]}',
'{ "name": "Moonlit Meadows", "description": "A serene and mystical area nestled between two great mountains, where the moon\'s gentle light illuminates the lush fields and forests. The air is filled with the sweet scent of blooming wildflowers, and the gentle chirping of nocturnal creatures can be heard in the distance. The area is home to a diverse array of magical creatures, including the Whimsy Woozle, the Lunar Lopster, and the Shadow Stag."}',
Expand Down Expand Up @@ -105,6 +107,8 @@ def test_apply_to_story(self):
assert(story.config.world_info == "a mix between alice in wonderland and the wizard of oz with a dark element")
assert(story.config.world_mood == 3)
assert(story.config.startlocation_player == "Moonlit Meadows.Greenhaven")
assert(isinstance(story.config.context, StoryContext))
assert(story.config.context.to_json() == StoryContext(base_story=story_background).to_json())

quest = None
assert(start_location.livings)
Expand Down

0 comments on commit d8fc907

Please sign in to comment.