django_system_test.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:opencensus-python 作者: census-instrumentation 项目源码 文件源码
def test_django_request_trace(self):
        requests.get(
            BASE_URL,
            headers=self.headers_trace)

        @retry(wait_fixed=RETRY_WAIT_PERIOD, stop_max_attempt_number=RETRY_MAX_ATTEMPT)
        def test_with_retry(self):
            trace = self.client.get_trace(trace_id=self.trace_id)
            spans = trace.get('spans')

            self.assertEqual(trace.get('projectId'), PROJECT)
            self.assertEqual(trace.get('traceId'), str(self.trace_id))
            self.assertEqual(len(spans), 1)

            for span in spans:
                labels = span.get('labels')
                self.assertEqual(labels.get('/http/status_code'), '200')

        test_with_retry(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号