Skip to content

Commit

Permalink
Update starlette tests
Browse files Browse the repository at this point in the history
  • Loading branch information
macieyng committed Apr 21, 2023
1 parent 2d4abcd commit 4ab455f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ def test_basic_starlette_call(self):
spans = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans), 3)
for span in spans:
self.assertIn("/foobar", span.name)
self.assertIn("GET /foobar", span.name)

def test_starlette_route_attribute_added(self):
"""Ensure that starlette routes are used as the span name."""
self._client.get("/user/123")
spans = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans), 3)
for span in spans:
self.assertIn("/user/{username}", span.name)
self.assertIn("GET /user/{username}", span.name)
self.assertEqual(
spans[-1].attributes[SpanAttributes.HTTP_ROUTE], "/user/{username}"
)
Expand Down

0 comments on commit 4ab455f

Please sign in to comment.