mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-16 23:03:49 +00:00
improved registration flow
This commit is contained in:
parent
39f0c5f544
commit
0eaca98229
10 changed files with 95 additions and 26 deletions
|
@ -19,9 +19,15 @@ from llama_stack.distribution.datatypes import * # noqa: F403
|
|||
|
||||
class TestSafety:
|
||||
@pytest.mark.asyncio
|
||||
async def test_shield_list(self, safety_stack):
|
||||
async def test_new_shield(self, safety_stack):
|
||||
_, shields_impl, shield = safety_stack
|
||||
await shields_impl.register_shield(shield)
|
||||
assert shield is not None
|
||||
assert shield.provider_resource_identifier == shield.identifier
|
||||
assert shield.provider_id is not None
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_shield_list(self, safety_stack):
|
||||
_, shields_impl, _ = safety_stack
|
||||
response = await shields_impl.list_shields()
|
||||
assert isinstance(response, list)
|
||||
assert len(response) >= 1
|
||||
|
@ -32,9 +38,7 @@ class TestSafety:
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_run_shield(self, safety_stack):
|
||||
safety_impl, shields_impl, shield = safety_stack
|
||||
|
||||
await shields_impl.register_shield(shield)
|
||||
safety_impl, _, shield = safety_stack
|
||||
|
||||
response = await safety_impl.run_shield(
|
||||
shield_id=shield.identifier,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue