Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmxgti committed May 20, 2023
1 parent d753c09 commit a70a561
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1799,3 +1799,20 @@ def test_extract_arns(saml, expected):
from tokendito import user

assert user.extract_arns(saml) == expected


def test_select_assumeable_role_no_tiles():
"""Test exiting when there are no assumable roles."""
from tokendito import aws

tiles = [
(
"https://acme.okta.org/home/amazon_aws/0123456789abcdef0123/456",
"saml_response",
"arn:aws:iam::000000000000:saml/name,arn:aws:iam::000000000000:role/name",
"Tile Label",
)
]
with pytest.raises(SystemExit) as err:
aws.select_assumeable_role(tiles)
assert err.value.code == 1

0 comments on commit a70a561

Please sign in to comment.