Skip to content

Commit

Permalink
Adds tests better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
josead committed Dec 30, 2024
1 parent 11b5abb commit 38c5f62
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions tests/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,12 @@ def test_double_capture_run_messages(set_event_loop: None) -> None:
)


def test_messages_history_reevaluate_system_prompt_clean(set_event_loop: None):
def test_dynamic_false_no_reevaluate(set_event_loop: None):
""" When dynamic is false (default), the system prompt is not reevaluated
i.e: SystemPromptPart(
content="A", <--- Remains the same when `message_history` is passed.
part_kind='system-prompt')
"""
agent = Agent('test', system_prompt='Foobar')

dynamic_value = "A"
Expand Down Expand Up @@ -1306,7 +1311,12 @@ async def func_two(ctx):
]
)

def test_messages_history_reevaluate_system_prompt_dirty(set_event_loop: None):
def test_dynamic_true_reevaluate_system_prompt(set_event_loop: None):
""" When dynamic is true, the system prompt is reevaluated
i.e: SystemPromptPart(
content="B", <--- Updated value
part_kind='system-prompt')
"""
agent = Agent('test', system_prompt='Foobar')

dynamic_value = "A"
Expand Down Expand Up @@ -1355,7 +1365,7 @@ async def func_two(ctx):
content='Foobar',
part_kind='system-prompt'),
SystemPromptPart(
content="B", # Updated value since dirty
content="B", # Updated value
part_kind='system-prompt'),
UserPromptPart(
content='Hello',
Expand All @@ -1382,7 +1392,8 @@ async def func_two(ctx):



def test_messages_history_reevaluate_system_prompt_dirty(set_event_loop: None):
def test_dynamic_true_evaluate_new_system_prompt(set_event_loop: None):
""" When new system prompt added with `dynamic` = True, they will be evaluated and added to the system parts, (besides the reevaluated ones)."""
agent = Agent('test', system_prompt='Foobar')

dynamic_value = "A"
Expand Down

0 comments on commit 38c5f62

Please sign in to comment.