def test_events(self): mock_observer = mock.Mock(spec=SpanObserver) span = Span(1, 2, 3, "name") span._register(mock_observer) span.start() self.assertEqual(mock_observer.on_start.call_count, 1) span.annotate("key", "value") mock_observer.on_annotate("key", "value") span.stop() mock_observer.on_stop(error=None)
def test_events(self): mock_observer = mock.Mock(spec=SpanObserver) span = Span(1, 2, 3, "name") span.register(mock_observer) span.start() self.assertEqual(mock_observer.on_start.call_count, 1) span.annotate("key", "value") mock_observer.on_annotate("key", "value") span.stop() mock_observer.on_stop(error=None)
def test_events(self): mock_observer = mock.Mock(spec=SpanObserver) span = Span(1, 2, 3, "name") span.register(mock_observer) span.start() self.assertEqual(mock_observer.on_start.call_count, 1) span.set_tag("key", "value") mock_observer.on_set_tag("key", "value") span.log("name", "payload") mock_observer.on_log("name", "payload") span.finish() mock_observer.on_finish(exc_info=None)
def test_events(self): mock_observer = mock.Mock(spec=SpanObserver) span = Span(1, 2, 3, None, 0, "name") span.register(mock_observer) span.start() self.assertEqual(mock_observer.on_start.call_count, 1) span.set_tag("key", "value") mock_observer.on_set_tag("key", "value") span.log("name", "payload") mock_observer.on_log("name", "payload") span.finish() mock_observer.on_finish(exc_info=None)