11import re
22
33from scim2_models import Context
4+ from scim2_models import Error
45from scim2_models import ListResponse
56from scim2_models import Schema
67
78from scim2_tester .schemas import check_schemas_endpoint
89from scim2_tester .utils import Status
910
1011
11- def test_schemas_endpoint (httpserver , check_config ):
12- """Test a fully functional resource types endpoint."""
12+ def test_shemas_endpoint (httpserver , check_config ):
13+ """Test a fully functional schemas endpoint."""
1314 schemas = [model .to_schema () for model in check_config .client .resource_models ]
1415 httpserver .expect_request (re .compile (r"^/Schemas$" )).respond_with_json (
1516 ListResponse [Schema ](
@@ -27,13 +28,18 @@ def test_schemas_endpoint(httpserver, check_config):
2728 status = 200 ,
2829 content_type = "application/scim+json" ,
2930 )
31+ httpserver .expect_request (re .compile (r"^/Schemas/.*$" )).respond_with_json (
32+ Error (status = 404 , detail = "Schema Not Found" ).model_dump (),
33+ status = 404 ,
34+ content_type = "application/scim+json" ,
35+ )
3036
3137 results = check_schemas_endpoint (check_config )
3238
3339 assert all (result .status == Status .SUCCESS for result in results )
3440
3541
36- def test_resource_missing_query_endpoint (httpserver , check_config ):
42+ def test_missing_query_endpoint (httpserver , check_config ):
3743 """Test that individual Schema endpoints are missing."""
3844 schemas = [model .to_schema () for model in check_config .client .resource_models ]
3945 httpserver .expect_request (re .compile (r"^/Schemas$" )).respond_with_json (
0 commit comments