Пример #1
0
 def test_current_root_span(self):
     # it should return the current active root span
     ctx = Context()
     span = Span(tracer=None, name='fake_span')
     ctx.add_span(span)
     assert span == ctx.get_current_root_span()
Пример #2
0
 def test_current_root_span_none(self):
     # it should return none when there is no root span
     ctx = Context()
     assert ctx.get_current_root_span() is None