-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic test for ElastiCache IAM provider
- Loading branch information
Showing
5 changed files
with
21 additions
and
0 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
-r test.txt | ||
-r publishing.txt | ||
-r recipes.txt | ||
black==24.10.0 | ||
ruff | ||
isort==5.13.2 | ||
|
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,3 @@ | ||
botocore | ||
cachetools | ||
|
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 |
---|---|---|
|
@@ -12,3 +12,6 @@ pytest-lazy-fixtures | |
pytest-mock | ||
pytest-reverse | ||
redis | ||
|
||
# Recipe test dependencies | ||
moto |
Empty file.
14 changes: 14 additions & 0 deletions
14
tests/recipes/credentials/test_elasticache_iam_provider.py
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,14 @@ | ||
from __future__ import annotations | ||
|
||
from moto import mock_aws | ||
|
||
from coredis.recipes.credentials import ElastiCacheIAMProvider | ||
|
||
|
||
class TestElastiCacheIAMProvider: | ||
async def test_get_credentials(self): | ||
with mock_aws(): | ||
provider = ElastiCacheIAMProvider("test_user", "test_cluster") | ||
user_pass = await provider.get_credentials() | ||
assert user_pass.username == "test_user" | ||
assert "test_cluster/?Action=connect&User=test_user" in user_pass.password |