-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove call to
_remove_guest_key
(#181)
* fix: remove call to _remove_guest_key * fix: update guest_login to None but not last_login * Add await args to expired guest key unit test * fix: extract expired guest key removal function --------- Co-authored-by: Taesung Hwang <[email protected]>
- Loading branch information
1 parent
4be0c4d
commit e436ff2
Showing
2 changed files
with
12 additions
and
2 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
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 |
---|---|---|
|
@@ -3,9 +3,11 @@ | |
from unittest.mock import AsyncMock, patch | ||
|
||
from auth import guest_auth | ||
from services.mongodb_handler import Collection | ||
|
||
guest_auth.AUTH_KEY_SALT = "not-a-good-idea".encode() | ||
SAMPLE_EMAIL = "[email protected]" | ||
SAMPLE_UID = "com.amazon.jeff" | ||
|
||
|
||
@patch("services.mongodb_handler.retrieve_one", autospec=True) | ||
|
@@ -73,7 +75,9 @@ async def test_expired_key_is_removed( | |
|
||
key = await guest_auth._get_existing_key(SAMPLE_EMAIL) | ||
assert key is None | ||
mock_mongodb_update_one.assert_awaited_once() | ||
mock_mongodb_update_one.assert_awaited_once_with( | ||
Collection.USERS, {"_id": SAMPLE_UID}, {"guest_auth": None} | ||
) | ||
|
||
|
||
@patch("services.mongodb_handler.retrieve_one", autospec=True) | ||
|