def test_tracer_custom_annotation(mocker, dummy_response, provider_stub):
    put_annotation_mock = mocker.MagicMock()
    annotation_key = "BookingId"
    annotation_value = "123456"

    provider = provider_stub(put_annotation_mock=put_annotation_mock)
    tracer = Tracer(provider=provider, service="booking")

    tracer.put_annotation(annotation_key, annotation_value)

    assert put_annotation_mock.call_count == 1
    assert put_annotation_mock.call_args == mocker.call(key=annotation_key,
                                                        value=annotation_value)
def test_tracer_custom_annotation(mocker, dummy_response, provider_stub):
    # GIVEN Tracer is initialized
    put_annotation_mock = mocker.MagicMock()
    provider = provider_stub(put_annotation_mock=put_annotation_mock)
    tracer = Tracer(provider=provider)

    # WHEN put_metadata is used
    annotation_key = "BookingId"
    annotation_value = "123456"
    tracer.put_annotation(annotation_key, annotation_value)

    # THEN we should have an annotation as expected
    assert put_annotation_mock.call_count == 1
    assert put_annotation_mock.call_args == mocker.call(key=annotation_key, value=annotation_value)