Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Feb 20, 2024
1 parent eeb7380 commit 110571a
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -695,14 +695,15 @@ def test_http_custom_response_headers_not_in_span_attributes(self):

class TestHTTPAppWithCustomHeadersParameters(TestBase):
"""Minimal tests here since the behavior of this logic is tested above and in the ASGI tests."""

def setUp(self):
super().setUp()
self.app = self._create_app()
otel_fastapi.FastAPIInstrumentor().instrument_app(
self.app,
http_capture_headers_server_request=["a.*", "b.*"],
http_capture_headers_server_response=["c.*", "d.*"],
http_capture_headers_sanitize_fields=[".*secret.*"]
http_capture_headers_sanitize_fields=[".*secret.*"],
)
self.client = TestClient(self.app)

Expand All @@ -728,9 +729,14 @@ async def _():
return app

def test_http_custom_request_headers_in_span_attributes(self):
resp = self.client.get("/foobar", headers={
"apple": "red", "banana-secret": "yellow", "fig": "green"
})
resp = self.client.get(
"/foobar",
headers={
"apple": "red",
"banana-secret": "yellow",
"fig": "green",
},
)
self.assertEqual(200, resp.status_code)
span_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(span_list), 3)
Expand Down

0 comments on commit 110571a

Please sign in to comment.