-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #945 from GSA/fix_service_invites
fix service invites
- Loading branch information
Showing
4 changed files
with
23 additions
and
76 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -398,34 +398,3 @@ def test_get_invited_user_404s_if_invite_doesnt_exist( | |
_expected_status=404, | ||
) | ||
assert json_resp["result"] == "error" | ||
|
||
|
||
def test_get_service_invite_data_with_invite(admin_request, mocker): | ||
redis_key = "[email protected]" | ||
expected_user_data = b'{"from_user_id": ["7480cdcf-fa31-42b8-a4bf-2cd4d7a9b4f4"], "service_id": "721b0aa6-2447-4bcd-91fc-26d576f2bbff", "permissions": ["manage_api_keys"], "folder_permissions": []}' # noqa | ||
expected_status = 200 | ||
|
||
mocker.patch( | ||
"app.service_invite.rest.redis_store.raw_get", return_value=expected_user_data | ||
) | ||
json_resp = json.loads( | ||
admin_request.get( | ||
"service_invite.get_service_invite_data", | ||
redis_key=redis_key, | ||
_expected_status=expected_status, | ||
) | ||
) | ||
assert json_resp["permissions"] == ["manage_api_keys"] | ||
|
||
|
||
def test_get_service_invite_data_without_invite(admin_request, mocker): | ||
redis_key = "[email protected]" | ||
|
||
mocker.patch("app.service_invite.rest.redis_store.raw_get", return_value=None) | ||
with pytest.raises(BaseException, match="No service invite data"): | ||
json.loads( | ||
admin_request.get( | ||
"service_invite.get_service_invite_data", | ||
redis_key=redis_key, | ||
) | ||
) |