Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
depsiatwal committed Jan 29, 2025
1 parent c560f94 commit 4d595eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/documents/libraries/tests/test_s3_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ def test_get_client_without_aws_endpoint_url(self, mock_Config, mock_boto3):
)
mock_boto3.client.assert_called_with(
"s3",
aws_access_key_id="AWS_ACCESS_KEY_ID",
aws_secret_access_key="AWS_SECRET_ACCESS_KEY",
region_name="AWS_REGION",
config=config,
)

@patch("api.documents.libraries.s3_operations._client")
def test_get_client(self, mock_client, mock_Config, mock_boto3):
def test_get_client_with_aws_endpoint_url(self, mock_Config, mock_boto3):
mock_client = Mock()
mock_boto3.client.return_value = mock_client

Expand All @@ -79,6 +80,8 @@ def test_get_client(self, mock_client, mock_Config, mock_boto3):
)
mock_boto3.client.assert_called_with(
"s3",
aws_access_key_id="AWS_ACCESS_KEY_ID",
aws_secret_access_key="AWS_SECRET_ACCESS_KEY",
region_name="AWS_REGION",
config=config,
endpoint_url="AWS_ENDPOINT_URL",
Expand Down

0 comments on commit 4d595eb

Please sign in to comment.