Skip to content

Commit 7ee86a5

Browse files
committed
tests: use a scim_client fixture in scim_server tests to avoid duplicating discoveries
1 parent 94966a9 commit 7ee86a5

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tests/test_scim2_server.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@
88
from scim2_tester.discovery import get_standard_resource_types
99

1010

11+
@pytest.fixture
12+
def scim_client(scim2_server_app):
13+
client = TestSCIMClient(Client(scim2_server_app))
14+
client.discover()
15+
return client
16+
17+
1118
@pytest.mark.xfail(
1219
reason="scim2-server don't correctly handle patch operation on extension roots"
1320
)
14-
def test_discovered_scim2_server(scim2_server_app):
21+
def test_discovered_scim2_server(scim_client):
1522
"""Test the complete SCIM server with discovery."""
16-
client = TestSCIMClient(Client(scim2_server_app))
17-
client.discover()
18-
results = check_server(client, raise_exceptions=False)
23+
results = check_server(scim_client, raise_exceptions=False)
1924

2025
executed_results = [r for r in results if r.status != Status.SKIPPED]
2126
assert len(executed_results) > 0
@@ -44,12 +49,13 @@ def test_undiscovered_scim2_server(scim2_server_app):
4449
)
4550
@pytest.mark.parametrize("tag", get_all_available_tags())
4651
@pytest.mark.parametrize("resource_type", [None] + get_standard_resource_types())
47-
def test_individual_filters(scim2_server_app, tag, resource_type):
52+
def test_individual_filters(scim_client, tag, resource_type):
4853
"""Test individual tags and resource types."""
49-
client = TestSCIMClient(Client(scim2_server_app))
50-
client.discover()
5154
results = check_server(
52-
client, raise_exceptions=True, include_tags={tag}, resource_types=resource_type
55+
scim_client,
56+
raise_exceptions=True,
57+
include_tags={tag},
58+
resource_types=resource_type,
5359
)
5460
for result in results:
5561
assert result.status in (Status.SUCCESS, Status.SKIPPED), (

0 commit comments

Comments
 (0)