Skip to content

Commit

Permalink
events: test Event name precedence in attributes (open-telemetry#4142)
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx authored Aug 22, 2024
1 parent 56ad0ce commit fe67d45
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions opentelemetry-api/tests/events/test_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ def test_event(self):
self.assertEqual(
event.attributes, {"key": "value", "event.name": "example"}
)

def test_event_name_copied_in_attributes(self):
event = Event("name", 123)
self.assertEqual(event.attributes, {"event.name": "name"})

def test_event_name_has_precedence_over_attributes(self):
event = Event("name", 123, attributes={"event.name": "attr value"})
self.assertEqual(event.attributes, {"event.name": "name"})

0 comments on commit fe67d45

Please sign in to comment.