@@ -550,18 +550,28 @@ def test_span_processor_accepts_parent_context(self):
550
550
)
551
551
552
552
def test_origin (self ):
553
- context = trace_api .SpanContext (
554
- trace_id = 0x000000000000000000000000DEADBEEF ,
555
- span_id = trace_api .INVALID_SPAN ,
556
- is_remote = True ,
557
- trace_state = trace_api .TraceState (
558
- [(datadog .constants .DD_ORIGIN , "origin-service" )]
559
- ),
553
+ trace_id = 0x000000000000000000000000DEADBEEF
554
+ trace_state = trace_api .TraceState (
555
+ [(datadog .constants .DD_ORIGIN , "origin-service" )]
556
+ )
557
+ parent_span_ctx = trace_api .SpanContext (
558
+ trace_id = trace_id ,
559
+ span_id = 0x1 ,
560
+ is_remote = False ,
561
+ trace_state = trace_state ,
562
+ )
563
+ child_span_ctx = trace_api .SpanContext (
564
+ trace_id = trace_id ,
565
+ span_id = 0x2 ,
566
+ is_remote = False ,
567
+ trace_state = trace_state ,
560
568
)
561
569
562
- root_span = trace ._Span (name = "root" , context = context , parent = None )
570
+ root_span = trace ._Span (
571
+ name = "root" , context = parent_span_ctx , parent = None
572
+ )
563
573
child_span = trace ._Span (
564
- name = "child" , context = context , parent = root_span
574
+ name = "child" , context = child_span_ctx , parent = parent_span_ctx
565
575
)
566
576
root_span .start ()
567
577
child_span .start ()
0 commit comments