Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

test: reduce flakiness of tz testing

Andy Li96efbf317f9e
diff --git a/tests/test_client.py b/tests/test_client.py
index f4606f994..d3de1bc11 100644
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -651,7 +651,6 @@ def test_initial_sequence(client: Letta):
def test_timezone(client: Letta):
- # create an agent
agent = client.agents.create(
memory_blocks=[{"label": "human", "value": ""}, {"label": "persona", "value": ""}],
model="letta/letta-free",
@@ -659,7 +658,6 @@ def test_timezone(client: Letta):
timezone="America/Los_Angeles",
)
- # get the timzone
agent = client.agents.retrieve(agent_id=agent.id)
assert agent.timezone == "America/Los_Angeles"
@@ -674,13 +672,11 @@ def test_timezone(client: Letta):
)
# second message is assistant message
assert response.messages[1].message_type == "assistant_message"
- # content is similar to current timezone
- assert (
- "America/Los_Angeles" in response.messages[1].content
- or "PDT" in response.messages[1].content
- or "PST" in response.messages[1].content
- or "Pacific Daylight Time" in response.messages[1].content
- or "Pacific Standard Time" in response.messages[1].content
+
+ pacific_tz_indicators = {"America/Los_Angeles", "PDT", "PST", "PT", "Pacific Daylight Time", "Pacific Standard Time", "Pacific Time"}
+ content = response.messages[1].content
+ assert any(
+ tz in content for tz in pacific_tz_indicators
), f"Response content: {response.messages[1].content} does not contain expected timezone"
# test updating the timezone