Skip to content

Commit

Permalink
✅ 🤡 add get interaction test
Browse files Browse the repository at this point in the history
  • Loading branch information
agn-7 committed Nov 18, 2023
1 parent e50b07b commit b369853
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,16 @@ def test_get_interactions(db):
assert interactions[1].settings["model_name"] == "model2"


def test_get_interaction(db):
timestamp = utils.convert_timezone(datetime.now())
interaction = models.Interaction(
settings=dict(model_name="model", role="role", prompt="prompt"),
created_at=timestamp,
updated_at=timestamp,
)
db.add(interaction)
db.commit()

retrieved_interaction = crud.get_interaction(db, interaction.id)
assert retrieved_interaction.id == interaction.id
assert retrieved_interaction.settings["model_name"] == "model"

0 comments on commit b369853

Please sign in to comment.