-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2875fac
commit 31a3ce7
Showing
4 changed files
with
129 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
Tests functions contained in src/auth.py | ||
""" | ||
|
||
import pytest | ||
|
||
import auth | ||
|
||
|
||
@pytest.mark.parametrize("mock_slack_bolt_async_app", ["auth"], indirect=True) | ||
class TestAuth: | ||
"""Groups tests for auth.py into a single scope""" | ||
|
||
@pytest.mark.asyncio | ||
async def test_is_admin_when_user_is_not_admin(self, mock_slack_bolt_async_app): | ||
"""Tests when a user is NOT a workspace admin""" | ||
result = await auth.is_admin("regular_user") | ||
|
||
assert result is False | ||
|
||
@pytest.mark.asyncio | ||
async def test_is_admin_when_user_is_admin(self, mock_slack_bolt_async_app): | ||
"""Tests when a user is a workspace admin""" | ||
result = await auth.is_admin("admin_user") | ||
|
||
assert result is True |
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