Skip to content

Commit

Permalink
🧪 Update pytest mark for trust registry e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Feb 4, 2025
1 parent 307ac02 commit 5704483
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions trustregistry/tests/e2e/test_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
from shared import TRUST_REGISTRY_URL
from shared.util.rich_async_client import RichAsyncClient

# Apply the marker to all tests in this module. Tests must run sequentially in same xdist group.
pytestmark = pytest.mark.xdist_group(name="trust_registry_test_group")

new_actor = {
"id": "darth-vader",
"name": "Darth Vader",
Expand Down Expand Up @@ -145,23 +148,22 @@ async def test_get_actor():

@pytest.mark.anyio
async def test_update_actor():
test_actor = generate_actor()
async with RichAsyncClient(raise_status_error=False) as client:
response = await client.put(
f"{TRUST_REGISTRY_URL}/registry/actors/{test_actor['id']}",
json=test_actor,
f"{TRUST_REGISTRY_URL}/registry/actors/{actor_id}",
json=new_actor,
)
assert response.status_code == 200
assert response.json() == test_actor
assert response.json() == new_actor

new_actors_response = await client.get(f"{TRUST_REGISTRY_URL}/registry/actors")
assert new_actors_response.status_code == 200
new_actors_list = new_actors_response.json()
assert test_actor in new_actors_list
assert new_actor in new_actors_list

response = await client.put(
f"{TRUST_REGISTRY_URL}/registry/actors/bad",
json=test_actor,
json=new_actor,
)
assert response.status_code == 400

Expand Down
4 changes: 2 additions & 2 deletions trustregistry/tests/e2e/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from shared.util.rich_async_client import RichAsyncClient
from trustregistry.registry.registry_schemas import SchemaID, _get_schema_attrs

# Apply the marker to all tests in this module
pytestmark = pytest.mark.xdist_group(name="schema_test_group")
# Apply the marker to all tests in this module. Tests must run sequentially in same xdist group.
pytestmark = pytest.mark.xdist_group(name="trust_registry_test_group")

schema_id = "string:2:string:string"
updated_schema_id = "string_updated:2:string_updated:string_updated"
Expand Down

0 comments on commit 5704483

Please sign in to comment.