-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix/msi 707 user id pool hook validation issue (#1571)
* Initial add of VSCode Dev Container * Potential fix for #1405 static site options issue * Fixing spelling issue * Adding unit test covering changed code
- Loading branch information
1 parent
72eeb8b
commit ee6bf91
Showing
3 changed files
with
35 additions
and
3 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Empty init for python import traversal.""" |
31 changes: 31 additions & 0 deletions
31
tests/unit/cfngin/hooks/staticsite/auth_at_edge/test_user_pool_id_retriever.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,31 @@ | ||
"""Test runway.cfngin.hooks.staticsite.auth_at_edge.user_pool_id_retriever.""" | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
from runway.cfngin.hooks.staticsite.auth_at_edge.user_pool_id_retriever import HookArgs | ||
|
||
MODULE = "runway.cfngin.hooks.staticsite.auth_at_edge.user_pool_id_retriever" | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"provided, expected", | ||
[ | ||
({"user_pool_arn": "abc123"}, {"user_pool_arn": "abc123"}), | ||
({"created_user_pool_id": "abc123"}, {"created_user_pool_id": "abc123"}), | ||
( | ||
{"created_user_pool_id": "abc123", "user_pool_arn": "abc123"}, | ||
{"created_user_pool_id": "abc123", "user_pool_arn": "abc123"}, | ||
), | ||
], | ||
) | ||
def test_hook_args_parse_obj( | ||
provided: dict[str, str], expected: dict[str, str] | ||
) -> None: | ||
"""Test HookArgs.parse_obj.""" | ||
kwargs = provided | ||
args = HookArgs.parse_obj(kwargs) | ||
if "user_pool_arn" in provided: | ||
assert args.user_pool_arn == expected["user_pool_arn"] | ||
if "created_user_pool_id" in provided: | ||
assert args.created_user_pool_id == expected["created_user_pool_id"] |