mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-09 21:18:38 +00:00
incorporating feedback
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
af33a8c982
commit
574dffbe38
5 changed files with 56 additions and 25 deletions
|
@ -46,6 +46,22 @@ class TestPrompts:
|
|||
assert updated.version == "2"
|
||||
assert updated.prompt == "Updated"
|
||||
|
||||
async def test_update_prompt_with_version(self, store):
|
||||
version_for_update = "1"
|
||||
|
||||
prompt = await store.create_prompt("Original")
|
||||
assert prompt.version == "1"
|
||||
prompt = await store.update_prompt(prompt.prompt_id, "Updated", {"v": "2"}, version_for_update)
|
||||
assert prompt.version == "2"
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
# now this is a stale version
|
||||
await store.update_prompt(prompt.prompt_id, "Another Update", {"v": "2"}, version_for_update)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
# this version does not exist
|
||||
await store.update_prompt(prompt.prompt_id, "Another Update", {"v": "2"}, "99")
|
||||
|
||||
async def test_delete_prompt(self, store):
|
||||
prompt = await store.create_prompt("to be deleted")
|
||||
await store.delete_prompt(prompt.prompt_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue