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