-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
31 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from rasa_sdk.tracing.tracer_register import ActionExecutorTracerRegister | ||
from opentelemetry import trace | ||
|
||
|
||
def test_tracer_register_is_singleton() -> None: | ||
tracer_register_1 = ActionExecutorTracerRegister() | ||
tracer_register_2 = ActionExecutorTracerRegister() | ||
|
||
assert tracer_register_1 is tracer_register_2 | ||
assert tracer_register_1.tracer is tracer_register_2.tracer | ||
|
||
|
||
def test_trace_register() -> None: | ||
tracer_register = ActionExecutorTracerRegister() | ||
assert tracer_register.get_tracer() is None | ||
|
||
tracer = trace.get_tracer(__name__) | ||
tracer_register.register_tracer(tracer) | ||
|
||
assert tracer_register.tracer == tracer | ||
assert tracer_register.get_tracer() == tracer |