import mock
import pytest


@pytest.fixture
def default_trace_id_generator(dummy_request):
    return lambda dummy_request: '17133d482ba4f605'


@pytest.fixture
def settings():
    return {
        'zipkin.tracing_percent': 100,
        'zipkin.trace_id_generator': default_trace_id_generator,
    }


@pytest.fixture
def get_span():
    return {
        'id': '1',
        'tags': {
            'http.uri': '/sample',
            'http.uri.qs': '/sample',
            'http.route': '/sample',
            'response_status_code': '200',
        },
        'name': 'GET /sample',
        'traceId': '17133d482ba4f605',
        'localEndpoint': {
            'ipv4': '127.0.0.1',
            'port': 80,
            'serviceName': 'acceptance_service',
        },
        'kind': 'SERVER',
        'timestamp': mock.ANY,
        'duration': mock.ANY,
    }

import mock
import pytest


@pytest.fixture
def default_trace_id_generator(dummy_request):
    return lambda dummy_request: '17133d482ba4f605'


@pytest.fixture
def settings():
    return {
        'zipkin.tracing_percent': 100,
        'zipkin.trace_id_generator': default_trace_id_generator,
    }


@pytest.fixture
def get_span():
    return {
        'id': '1',
        'tags': {
            'http.uri': '/sample',
            'http.uri.qs': '/sample',
            'http.route': '/sample',
            'response_status_code': '200',
        },
        'name': 'GET /sample',
        'traceId': '17133d482ba4f605',
        'localEndpoint': {
            'ipv4': mock.ANY,
            'port': 80,
            'serviceName': 'acceptance_service',
        },
        'kind': 'SERVER',
        'timestamp': mock.ANY,
        'duration': mock.ANY,
    }

Allow any ip in the get_span expected span since it's not deterministic
Allow any ip in the get_span expected span since it's not deterministic

  import mock
  import pytest
  
  
  @pytest.fixture
  def default_trace_id_generator(dummy_request):
      return lambda dummy_request: '17133d482ba4f605'
  
  
  @pytest.fixture
  def settings():
      return {
          'zipkin.tracing_percent': 100,
          'zipkin.trace_id_generator': default_trace_id_generator,
      }
  
  
  @pytest.fixture
  def get_span():
      return {
          'id': '1',
          'tags': {
              'http.uri': '/sample',
              'http.uri.qs': '/sample',
              'http.route': '/sample',
              'response_status_code': '200',
          },
          'name': 'GET /sample',
          'traceId': '17133d482ba4f605',
          'localEndpoint': {
-             'ipv4': '127.0.0.1',
+             'ipv4': mock.ANY,
              'port': 80,
              'serviceName': 'acceptance_service',
          },
          'kind': 'SERVER',
          'timestamp': mock.ANY,
          'duration': mock.ANY,
      }
  
Allow any ip in the get_span expected span since it's not deterministic
## Code Before:
import mock
import pytest


@pytest.fixture
def default_trace_id_generator(dummy_request):
    return lambda dummy_request: '17133d482ba4f605'


@pytest.fixture
def settings():
    return {
        'zipkin.tracing_percent': 100,
        'zipkin.trace_id_generator': default_trace_id_generator,
    }


@pytest.fixture
def get_span():
    return {
        'id': '1',
        'tags': {
            'http.uri': '/sample',
            'http.uri.qs': '/sample',
            'http.route': '/sample',
            'response_status_code': '200',
        },
        'name': 'GET /sample',
        'traceId': '17133d482ba4f605',
        'localEndpoint': {
            'ipv4': '127.0.0.1',
            'port': 80,
            'serviceName': 'acceptance_service',
        },
        'kind': 'SERVER',
        'timestamp': mock.ANY,
        'duration': mock.ANY,
    }

## Instruction:
Allow any ip in the get_span expected span since it's not deterministic
## Code After:
import mock
import pytest


@pytest.fixture
def default_trace_id_generator(dummy_request):
    return lambda dummy_request: '17133d482ba4f605'


@pytest.fixture
def settings():
    return {
        'zipkin.tracing_percent': 100,
        'zipkin.trace_id_generator': default_trace_id_generator,
    }


@pytest.fixture
def get_span():
    return {
        'id': '1',
        'tags': {
            'http.uri': '/sample',
            'http.uri.qs': '/sample',
            'http.route': '/sample',
            'response_status_code': '200',
        },
        'name': 'GET /sample',
        'traceId': '17133d482ba4f605',
        'localEndpoint': {
            'ipv4': mock.ANY,
            'port': 80,
            'serviceName': 'acceptance_service',
        },
        'kind': 'SERVER',
        'timestamp': mock.ANY,
        'duration': mock.ANY,
    }
