Skip to content

Commit

Permalink
Update test_memory_by_user.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zAlweNy26 committed Oct 23, 2023
1 parent 418577c commit 0236330
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/tests/routes/memory/test_memory_by_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@
# episodic memories are saved having the correct user
def test_episodic_memory_by_user(client):

# send websocket message from user A
# send websocket message from user C
send_websocket_message({
"text": "I am user C",
}, client, user_id="C")

# episodic recall (no user)
params = {
"text": "I am user C"
"text": "I am user"
}
response = client.get(f"/memory/recall/", params=params, headers={"user_id": "C"})
response = client.get(f"/memory/recall/", params=params)
json = response.json()
assert response.status_code == 200
episodic_memories = json["vectors"]["collections"]["episodic"]
assert len(episodic_memories) == 1
assert len(episodic_memories) == 0

# episodic recall (memories from non existing user)
params = {
"text": "I am user A"
"text": "I am user not existing"
}
response = client.get(f"/memory/recall/", params=params, headers={"user_id": "A"})
response = client.get(f"/memory/recall/", params=params, headers={"user_id": "not_existing"})
json = response.json()
assert response.status_code == 200
episodic_memories = json["vectors"]["collections"]["episodic"]
assert len(episodic_memories) == 0

# episodic recall (memories from user A)
# episodic recall (memories from user C)
params = {
"text": "I am user C"
}
Expand Down

0 comments on commit 0236330

Please sign in to comment.