@@ -845,9 +845,12 @@ def test_groups(admin: KeycloakAdmin, user: str):
845845 assert res is not None , res
846846 assert res ["id" ] == subgroup_id_1 , res
847847
848- with pytest .raises (KeycloakGetError ) as err :
849- admin .get_group_by_path (path = "/main-group/subgroup-2/subsubgroup-1/test" )
850- assert err .match ('404: b\' {"error":"Group path does not exist".*}\' ' )
848+ res = admin .get_group_by_path (path = "/main-group/subgroup-2/subsubgroup-1/test" )
849+ assert res == {
850+ "error" : "Group path does not exist" ,
851+ "error_description" : "For more on this error consult the server log at the "
852+ "debug level." ,
853+ }, res
851854
852855 res = admin .get_group_by_path (path = "/main-group/subgroup-2/subsubgroup-1" )
853856 assert res is not None , res
@@ -3947,9 +3950,12 @@ async def test_a_groups(admin: KeycloakAdmin, user: str):
39473950 assert res is not None , res
39483951 assert res ["id" ] == subgroup_id_1 , res
39493952
3950- with pytest .raises (KeycloakGetError ) as err :
3951- await admin .a_get_group_by_path (path = "/main-group/subgroup-2/subsubgroup-1/test" )
3952- assert err .match ('404: b\' {"error":"Group path does not exist".*}\' ' )
3953+ res = await admin .a_get_group_by_path (path = "/main-group/subgroup-2/subsubgroup-1/test" )
3954+ assert res == {
3955+ "error" : "Group path does not exist" ,
3956+ "error_description" : "For more on this error consult the server log at the "
3957+ "debug level." ,
3958+ }, res
39533959
39543960 res = await admin .a_get_group_by_path (path = "/main-group/subgroup-2/subsubgroup-1" )
39553961 assert res is not None , res
0 commit comments