# Path: opentracing_instrumentation/client_hooks/strict_redis.py
# IPV4_RE = re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$')
# METHOD_NAMES = ['execute_command', 'get', 'set', 'setex', 'setnx']
# ORIG_METHODS = {}
# def install_patches():
#     def peer_tags(self):
#     def get(self, name, **kwargs):
#     def set(self, name, value, ex=None, px=None, nx=False, xx=False, **kwargs):
#     def setex(self, name, time, value, **kwargs):
#     def setnx(self, name, value, **kwargs):
#     def execute_command(self, cmd, *args, **kwargs):
# def reset_patches():


from builtins import object
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import strict_redis
import redis
import random
import opentracing
import pytest
@pytest.fixture()
def key():
    return '%x' % random.randint(1, 10000000)


class Span(object):

    def __init__(self):
        self.tags = {}

    def set_tag(self, key, val):
        self.tags[key] = val

    def __enter__(self):
        return self

    def __exit__(self, *args, **kwargs):
        pass


class StartSpan(object):

    def __init__(self, span):
        self.kwargs = None
        self.args = None
        self.span = span

    def __call__(self, *args, **kwargs):
        self.kwargs = kwargs
        self.args = args

# Path: opentracing_instrumentation/client_hooks/strict_redis.py
# IPV4_RE = re.compile(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$')
# METHOD_NAMES = ['execute_command', 'get', 'set', 'setex', 'setnx']
# ORIG_METHODS = {}
# def install_patches():
#     def peer_tags(self):
#     def get(self, name, **kwargs):
#     def set(self, name, value, ex=None, px=None, nx=False, xx=False, **kwargs):
#     def setex(self, name, time, value, **kwargs):
#     def setnx(self, name, value, **kwargs):
#     def execute_command(self, cmd, *args, **kwargs):
# def reset_patches():


# Path: tests/opentracing_instrumentation/test_redis.py
from builtins import object
from opentracing.ext import tags
from opentracing_instrumentation.client_hooks import strict_redis
import redis
import random
import opentracing
import pytest

@pytest.fixture()
def key():
    return '%x' % random.randint(1, 10000000)


class Span(object):

    def __init__(self):
        self.tags = {}

    def set_tag(self, key, val):
        self.tags[key] = val

    def __enter__(self):
        return self

    def __exit__(self, *args, **kwargs):
        pass


class StartSpan(object):

    def __init__(self, span):
        self.kwargs = None
        self.args = None
        self.span = span

    def __call__(self, *args, **kwargs):
        self.kwargs = kwargs
        self.args = args

        return self.span