-
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
2 changed files
with
52 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from rasa_sdk.tracing.trace_provider import TraceProvider | ||
from opentelemetry import trace | ||
|
||
|
||
def test_anonymization_pipeline_provider_is_singleton() -> None: | ||
trace_provider_1 = TraceProvider() | ||
trace_provider_2 = TraceProvider() | ||
|
||
assert trace_provider_1 is trace_provider_2 | ||
assert trace_provider_1.tracer is trace_provider_2.tracer | ||
|
||
|
||
def test_trace_provider() -> None: | ||
trace_provider = TraceProvider() | ||
tracer = trace.get_tracer(__name__) | ||
trace_provider.register_tracer(tracer) | ||
|
||
assert trace_provider.tracer == tracer | ||
assert trace_provider.get_tracer() == tracer |