File tree 1 file changed +7
-0
lines changed
instrumentation/opentelemetry-instrumentation-pika/tests
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 18
18
from wrapt import BoundFunctionWrapper
19
19
20
20
from opentelemetry .instrumentation .pika import PikaInstrumentor
21
+ from opentelemetry .instrumentation .pika .pika_instrumentor import _consumer_callback_attribute_name
21
22
from opentelemetry .instrumentation .pika .utils import dummy_callback
22
23
from opentelemetry .trace import Tracer
23
24
@@ -113,3 +114,9 @@ def test_uninstrument_channel_functions(self) -> None:
113
114
self .channel .basic_publish ._original_function = original_function
114
115
PikaInstrumentor ._uninstrument_channel_functions (self .channel )
115
116
self .assertEqual (self .channel .basic_publish , original_function )
117
+
118
+ def test_consumer_callback_attribute_name (self ) -> None :
119
+ with mock .patch ("pika.__version__" , "1.0.0" ):
120
+ assert _consumer_callback_attribute_name () == "on_message_callback"
121
+ with mock .patch ("pika.__version__" , "0.12.0" ):
122
+ assert _consumer_callback_attribute_name () == "consumer_cb"
You can’t perform that action at this time.
0 commit comments