diff --git a/opentelemetry-api/tests/events/test_event.py b/opentelemetry-api/tests/events/test_event.py index b741cc65e23..227dcf5b1ff 100644 --- a/opentelemetry-api/tests/events/test_event.py +++ b/opentelemetry-api/tests/events/test_event.py @@ -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"})