File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 2020 decode_token_data ,
2121 TokenError ,
2222 ServerType ,
23+ WorkspaceRole ,
2324)
2425from ..client_push import push_project_async , push_project_cancel
2526from ..client_pull import (
@@ -2886,3 +2887,24 @@ def test_mc_without_login():
28862887 # without login should not be able to access workspaces
28872888 with pytest .raises (ClientError , match = "Authentication information is missing or invalid." ):
28882889 mc .workspaces_list ()
2890+
2891+
2892+ def test_do_request_error_handling (mc : MerginClient ):
2893+
2894+ try :
2895+ mc .
get (
"/v2/sso/[email protected] " )
2896+ except ClientError as e :
2897+ assert e .http_error == 404
2898+ assert (
2899+ e .detail
2900+ == "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
2901+ )
2902+ assert ": 404," in e .server_response
2903+
2904+ workspaces = mc .workspaces_list ()
2905+
2906+ try :
2907+ mc .
create_user (
"[email protected] " ,
"123" ,
workspace_id = workspaces [
0 ][
"id" ],
workspace_role = WorkspaceRole .
GUEST )
2908+ except ClientError as e :
2909+ assert e .http_error == 400
2910+ assert "Passwords must be at least 8 characters long." in e .detail
You can’t perform that action at this time.
0 commit comments