-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hashing based on reduced verification token length and changes
- Loading branch information
1 parent
91785ed
commit 684d11e
Showing
7 changed files
with
102 additions
and
27 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
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
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ def test_password_req_to_policy(self): | |
@patch("getpass.getpass", side_effect=["Password123!", "Password123!"]) | ||
@patch( | ||
"builtins.input", | ||
side_effect=["1", "[email protected]", "test", "test", "test", "y"], | ||
side_effect=["1", "[email protected]", "test", "test", "test", "y", "test"], | ||
) | ||
def test_prompt_and_set_token_registration( | ||
self, mock_input, mock_getpass, mock_server | ||
|
@@ -30,16 +30,22 @@ def test_prompt_and_set_token_registration( | |
mock_auth_client.set_token_by_registration.return_value = ( | ||
True, | ||
"Registration successful", | ||
"dummy_token", | ||
) | ||
mock_auth_client.validate_email.return_value = (True, "") | ||
mock_auth_client.verify_email.return_value = (True, "Verification successful") | ||
PromptAgent.prompt_and_set_token(user_auth_handler=mock_auth_client) | ||
mock_auth_client.set_token_by_registration.assert_called_once() | ||
|
||
@patch("getpass.getpass", side_effect=["password123"]) | ||
@patch("builtins.input", side_effect=["2", "[email protected]"]) | ||
def test_prompt_and_set_token_login(self, mock_input, mock_getpass): | ||
mock_auth_client = MagicMock() | ||
mock_auth_client.set_token_by_login.return_value = (True, "Login successful") | ||
mock_auth_client.set_token_by_login.return_value = ( | ||
True, | ||
"Login successful", | ||
200, | ||
) | ||
PromptAgent.prompt_and_set_token(user_auth_handler=mock_auth_client) | ||
mock_auth_client.set_token_by_login.assert_called_once() | ||
|
||
|
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