-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to validate that client is being reused
- Loading branch information
1 parent
2f18b30
commit e4a0c42
Showing
3 changed files
with
55 additions
and
14 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,35 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
# thumbor aws extensions | ||
# https://github.com/thumbor/thumbor-aws | ||
|
||
# Licensed under the MIT license: | ||
# http://www.opensource.org/licenses/mit-license | ||
# Copyright (c) 2021 Bernardo Heynemann heynemann@gmail.com | ||
|
||
|
||
import pytest | ||
from preggy import expect | ||
from tornado.testing import gen_test | ||
|
||
from tests import BaseS3TestCase | ||
|
||
import thumbor_aws.s3_client | ||
|
||
|
||
@pytest.mark.usefixtures("test_images") | ||
class S3ClientTestCase(BaseS3TestCase): | ||
@gen_test | ||
async def test_should_reuse_the_same_client(self): | ||
""" | ||
Verifies that the S3 client module will | ||
reuse the same AioBoto client. | ||
""" | ||
s3client = await thumbor_aws.s3_client.S3Client( | ||
self.context | ||
).get_client() | ||
s3client2 = await thumbor_aws.s3_client.S3Client( | ||
self.context | ||
).get_client() | ||
expect(s3client).to_equal(s3client2) |
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