Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events: test Event name precedence in attributes #4142

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"})