Lightweight containerized prosody tooling + moved auth scripts + xmpp reconnect/auth stabilization
This commit is contained in:
21
core/tests/test_tracing_helpers.py
Normal file
21
core/tests/test_tracing_helpers.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
from core.observability.tracing import ensure_trace_id
|
||||
|
||||
|
||||
class TracingHelpersTests(SimpleTestCase):
|
||||
def test_ensure_trace_id_prefers_explicit_value(self):
|
||||
self.assertEqual(
|
||||
"abc123",
|
||||
ensure_trace_id("abc123", {"trace_id": "payload"}),
|
||||
)
|
||||
|
||||
def test_ensure_trace_id_uses_payload_value(self):
|
||||
self.assertEqual(
|
||||
"payload-value",
|
||||
ensure_trace_id("", {"trace_id": "payload-value"}),
|
||||
)
|
||||
|
||||
def test_ensure_trace_id_generates_when_missing(self):
|
||||
trace_id = ensure_trace_id("", {})
|
||||
self.assertEqual(32, len(trace_id))
|
||||
Reference in New Issue
Block a user