Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def test_getting_resource_cm(event_loop):
"""Simple getting of resource."""
aioboto3.DEFAULT_SESSION = None
async with aioboto3.resource('dynamodb', loop=event_loop, region_name='eu-central-1') as resource:
assert isinstance(resource.meta.client, AioBaseClient)
async def test_getting_resource(event_loop):
"""Simple getting of resource."""
aioboto3.DEFAULT_SESSION = None
resource = aioboto3.resource('dynamodb', loop=event_loop, region_name='eu-central-1')
assert isinstance(resource.meta.client, AioBaseClient)
await resource.close()
async def _initialize(self):
"""Initialize our async resources: aiohttp, aioboto3"""
self.http = aiohttp.ClientSession()
self.dynamo = aioboto3.resource('dynamodb', region_name=DYNAMO_REGION)
self.ddb_user_table = self.dynamo.Table(DYNAMO_USER_TABLE)
self.ddb_entity_table = self.dynamo.Table(DYNAMO_ENTITY_TABLE)
log.info("DDB client initialized")