# Path: opentracing_instrumentation/client_hooks/boto3.py
# class Boto3Patcher(Patcher):
#         class InstrumentedExecutor(_Executor):
#     S3_FUNCTIONS_TO_INSTRUMENT = (
#         'copy',
#         'download_file',
#         'download_fileobj',
#         'upload_file',
#         'upload_fileobj',
#     )
#     def __init__(self):
#     def _install_patches(self):
#     def _reset_patches(self):
#     def set_request_id_tag(span, response):
#     def _get_service_action_call_wrapper(self):
#         def service_action_call_wrapper(service, parent, *args, **kwargs):
#     def _get_client_make_api_call_wrapper(self):
#         def make_api_call_wrapper(client, operation_name, api_params):
#     def _get_s3_call_wrapper(self, original_func):
#         def s3_call_wrapper(*args, **kwargs):
#     def perform_call(self, original_func, kind, service_name, operation_name,
#                      *args, **kwargs):
#     def _get_instrumented_executor_cls(self):
#             def submit(self, task, *args, **kwargs):


import datetime
import io
import boto3
import mock
import pytest
import requests
import testfixtures
    import moto
    import moto
        import moto
from botocore.exceptions import ClientError
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import boto3 as boto3_hooks

    response = users.get_item(Key={'username': 'janedoe'})
    user = response['Item']
    assert user['first_name'] == 'Jane'
    assert user['last_name'] == 'Doe'
    assert_last_span('resource', 'dynamodb', 'get_item', tracer, response)

    try:
        dynamodb.Table('test').delete_item(Key={'username': 'janedoe'})
    except ClientError as error:
        response = error.response
    assert_last_span('resource', 'dynamodb', 'delete_item', tracer, response)

    response = users.creation_date_time
    assert isinstance(response, datetime.datetime)
    assert_last_span('resource', 'dynamodb', 'describe_table', tracer)


def _test_s3(s3, tracer):
    fileobj = io.BytesIO(b'test data')
    bucket = 'test-bucket'

    response = s3.create_bucket(Bucket=bucket)
    assert_last_span('client', 's3', 'create_bucket', tracer, response)

    response = s3.upload_fileobj(fileobj, bucket, 'test.txt')
    assert_last_span('client', 's3', 'upload_fileobj', tracer, response)


def is_service_running(endpoint_url, expected_status_code):

# Path: opentracing_instrumentation/client_hooks/boto3.py
# class Boto3Patcher(Patcher):
#         class InstrumentedExecutor(_Executor):
#     S3_FUNCTIONS_TO_INSTRUMENT = (
#         'copy',
#         'download_file',
#         'download_fileobj',
#         'upload_file',
#         'upload_fileobj',
#     )
#     def __init__(self):
#     def _install_patches(self):
#     def _reset_patches(self):
#     def set_request_id_tag(span, response):
#     def _get_service_action_call_wrapper(self):
#         def service_action_call_wrapper(service, parent, *args, **kwargs):
#     def _get_client_make_api_call_wrapper(self):
#         def make_api_call_wrapper(client, operation_name, api_params):
#     def _get_s3_call_wrapper(self, original_func):
#         def s3_call_wrapper(*args, **kwargs):
#     def perform_call(self, original_func, kind, service_name, operation_name,
#                      *args, **kwargs):
#     def _get_instrumented_executor_cls(self):
#             def submit(self, task, *args, **kwargs):


# Path: tests/opentracing_instrumentation/test_boto3.py
import datetime
import io
import boto3
import mock
import pytest
import requests
import testfixtures
    import moto
    import moto
        import moto
from botocore.exceptions import ClientError
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import boto3 as boto3_hooks


    response = users.get_item(Key={'username': 'janedoe'})
    user = response['Item']
    assert user['first_name'] == 'Jane'
    assert user['last_name'] == 'Doe'
    assert_last_span('resource', 'dynamodb', 'get_item', tracer, response)

    try:
        dynamodb.Table('test').delete_item(Key={'username': 'janedoe'})
    except ClientError as error:
        response = error.response
    assert_last_span('resource', 'dynamodb', 'delete_item', tracer, response)

    response = users.creation_date_time
    assert isinstance(response, datetime.datetime)
    assert_last_span('resource', 'dynamodb', 'describe_table', tracer)


def _test_s3(s3, tracer):
    fileobj = io.BytesIO(b'test data')
    bucket = 'test-bucket'

    response = s3.create_bucket(Bucket=bucket)
    assert_last_span('client', 's3', 'create_bucket', tracer, response)

    response = s3.upload_fileobj(fileobj, bucket, 'test.txt')
    assert_last_span('client', 's3', 'upload_fileobj', tracer, response)


def is_service_running(endpoint_url, expected_status_code):

    try: