-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test notebook to get the latest notification
- Loading branch information
1 parent
f203c63
commit c19853e
Showing
1 changed file
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
"\n", | ||
"# syft absolute\n", | ||
"import syft as sy\n", | ||
"from syft import SyftError\n", | ||
"from syft import SyftSuccess\n", | ||
"\n", | ||
"server = sy.orchestra.launch(\n", | ||
|
@@ -55,12 +56,15 @@ | |
"outputs": [], | ||
"source": [ | ||
"datasite_client = server.login(email=\"[email protected]\", password=\"changethis\")\n", | ||
"datasite_client.register(\n", | ||
" email=\"user@openmined.org\",\n", | ||
"res = datasite_client.register(\n", | ||
" email=\"new_syft_user@openmined.org\",\n", | ||
" password=\"verysecurepassword\",\n", | ||
" password_verify=\"verysecurepassword\",\n", | ||
" name=\"New User\",\n", | ||
")" | ||
")\n", | ||
"\n", | ||
"if not isinstance(res, SyftSuccess):\n", | ||
" raise Exception(f\"Res isn't SyftSuccess, its {res}\")" | ||
] | ||
}, | ||
{ | ||
|
@@ -87,25 +91,15 @@ | |
"outputs": [], | ||
"source": [ | ||
"guest_client = server.login_as_guest()\n", | ||
"res = guest_client.users.forgot_password(email=\"user@openmined.org\")\n", | ||
"res = guest_client.users.forgot_password(email=\"new_syft_user@openmined.org\")\n", | ||
"\n", | ||
"if not isinstance(res, SyftSuccess):\n", | ||
" raise Exception(f\"Res isn't SyftSuccess, its {res}\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "8", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"res" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "9", | ||
"id": "8", | ||
"metadata": {}, | ||
"source": [ | ||
"### Admin generates a temp token" | ||
|
@@ -114,12 +108,12 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "10", | ||
"id": "9", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"temp_token = datasite_client.users.request_password_reset(\n", | ||
" datasite_client.notifications[0].linked_obj.resolve.id\n", | ||
" datasite_client.notifications[-1].linked_obj.resolve.id\n", | ||
")\n", | ||
"\n", | ||
"if not isinstance(temp_token, str):\n", | ||
|
@@ -128,7 +122,7 @@ | |
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "11", | ||
"id": "10", | ||
"metadata": {}, | ||
"source": [ | ||
"### User use this token to reset password" | ||
|
@@ -137,7 +131,7 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "12", | ||
"id": "11", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -150,13 +144,15 @@ | |
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "13", | ||
"id": "12", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"new_user_session = server.login(email=\"[email protected]\", password=\"Password123\")\n", | ||
"new_user_session = server.login(\n", | ||
" email=\"[email protected]\", password=\"Password123\"\n", | ||
")\n", | ||
"\n", | ||
"if not isinstance(new_user_session, SyftSuccess):\n", | ||
"if isinstance(new_user_session, SyftError):\n", | ||
" raise Exception(f\"Res isn't SyftSuccess, its {new_user_session}\")" | ||
] | ||
} | ||
|