File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ Here is an example of usage:
4141``` python
4242import datetime
4343from httpx import Client
44- from scim2_models import Error
44+ from scim2_client import SCIMResponseErrorObject
4545from scim2_client.engines.httpx import SyncSCIMClient
4646
4747client = Client(base_url = " https://auth.example/scim/v2" , headers = {" Authorization" : " Bearer foobar" })
@@ -66,9 +66,11 @@ assert user.meta.last_modified == datetime.datetime(
6666
6767# Create resources
6868user = User(user_name = " bjensen@example.com" )
69- response = scim.create(user)
70- assert isinstance (response, Error)
71- assert response.detail == " One or more of the attribute values are already in use or are reserved."
69+ try :
70+ scim.create(user)
71+ except SCIMResponseErrorObject as exc:
72+ error = exc.to_error()
73+ assert error.detail == " One or more of the attribute values are already in use or are reserved."
7274```
7375
7476scim2-client belongs in a collection of SCIM tools developed by [ Yaal Coop] ( https://yaal.coop ) ,
You can’t perform that action at this time.
0 commit comments