File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed
Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change 11from commercetools .platform import models
22from commercetools .platform .client import Client as PlatformClient
3- from commercetools .platform .models ._schemas .error import ErrorResponseSchema
43from commercetools .platform .models import (
54 ErrorResponse ,
65 ExtensionNoResponseError ,
76 QueryTimedOutError ,
87)
8+ from commercetools .platform .models ._schemas .error import ErrorResponseSchema
99
1010
1111def test_raises_exception (ct_platform_client : PlatformClient ):
@@ -104,17 +104,20 @@ def test_error_response_serialize():
104104 }
105105 assert data == expected
106106
107+
107108def test_error_response_deserialize ():
108- data = ErrorResponseSchema ().load ({
109- "statusCode" : 409 ,
110- "message" : "Version mismatch. Concurrent modification." ,
111- "errors" : [
112- {
113- "currentVersion" : 4 ,
114- "code" : "ConcurrentModification" ,
115- "message" : "Version mismatch. Concurrent modification." ,
116- "somethingElse" : "yes"
117- }
118- ],
119- })
109+ data = ErrorResponseSchema ().load (
110+ {
111+ "statusCode" : 409 ,
112+ "message" : "Version mismatch. Concurrent modification." ,
113+ "errors" : [
114+ {
115+ "currentVersion" : 4 ,
116+ "code" : "ConcurrentModification" ,
117+ "message" : "Version mismatch. Concurrent modification." ,
118+ "somethingElse" : "yes" ,
119+ }
120+ ],
121+ }
122+ )
120123 assert data .errors [0 ].somethingElse == "yes"
You can’t perform that action at this time.
0 commit comments