Skip to content

Commit

Permalink
Fix boto3 session
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvieirasilva committed Jul 15, 2022
1 parent ad224f8 commit 05d7a5f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [1.0.2] - 2022-07-15

### Fixed

- Fix the boto3 session when the profile is not set.

## [1.0.1] - 2022-02-17

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion aws_codeartifact_poetry/aws/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def get_session(region="us-east-1", profile=None, role=None, context=None):
aws_session_token=credentials['SessionToken']
)

return boto3
return boto3.Session(region_name=region)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aws-codeartifact-poetry"
version = "1.0.1"
version = "1.0.2"
description = "AWS CodeArtifact Poetry CLI"
license = "Proprietary"
authors = [ "Lucas Vieira <[email protected]>" ]
Expand Down
6 changes: 2 additions & 4 deletions tests/aws/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ def test_session_default(mock_sts):
"""Should return the default boto3 object."""
result = session.get_session()

assert boto3 == result
assert type(result) is not boto3.Session
assert type(result) is boto3.Session


@patch("aws_codeartifact_poetry.aws.session.boto3")
Expand All @@ -30,8 +29,7 @@ def test_session_with_role_without_context(mock_sts):
"""Should return the default boto3 object."""
result = session.get_session(role=IAM_ROLE)

assert boto3 == result
assert type(result) is not boto3.Session
assert type(result) is boto3.Session


def test_session_with_role_and_context(mock_sts):
Expand Down

0 comments on commit 05d7a5f

Please sign in to comment.