-
Notifications
You must be signed in to change notification settings - Fork 468
Closed
Description
=================================== FAILURES ===================================
__________ HTTPLibTestCase.test_httplib_request_and_response_headers ___________
self = <tests.contrib.httplib.test_httplib.HTTPLibTestCase testMethod=test_httplib_request_and_response_headers>
def test_httplib_request_and_response_headers(self):
# Disabled when not configured
conn = self.get_http_connection(SOCKET)
with contextlib.closing(conn):
conn.request('GET', '/status/200', headers={'my-header': 'my_value'})
conn.getresponse()
spans = self.tracer.writer.pop()
s = spans[0]
self.assertEqual(s.get_tag('http.request.headers.my_header'), None)
self.assertEqual(s.get_tag('http.response.headers.access_control_allow_origin'), None)
# Enabled when configured
with self.override_config('hhtplib', {}):
from ddtrace.settings import IntegrationConfig
integration_config = config.httplib # type: IntegrationConfig
integration_config.http.trace_headers(['my-header', 'access-control-allow-origin'])
conn = self.get_http_connection(SOCKET)
with contextlib.closing(conn):
conn.request('GET', '/status/200', headers={'my-header': 'my_value'})
conn.getresponse()
spans = self.tracer.writer.pop()
s = spans[0]
self.assertEqual(s.get_tag('http.request.headers.my-header'), 'my_value')
> self.assertEqual(s.get_tag('http.response.headers.access-control-allow-origin'), '*')
E AssertionError: None != '*'
tests/contrib/httplib/test_httplib.py:367: AssertionError
Metadata
Metadata
Assignees
Labels
No labels