Skip to content

Commit 8527640

Browse files
james02135ryanlerch
authored andcommitted
new properties added to schema in accordance with new Fedora Messaging requirements
Signed-off-by: james02135 <james02135@hotmail.com>
1 parent e2bde23 commit 8527640

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

bugzilla2fedmsg_schema/schema.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ def _all_emails(self):
144144
users.sort()
145145
return users
146146

147+
@property
148+
def agent_name(self):
149+
"""Return the name of the user who reported the bug message"""
150+
return self.body["bug"]["reporter"]["real_name"]
151+
152+
@property
153+
def app_name(self):
154+
return "bugzilla2fedmsg"
155+
147156

148157
class MessageV1(BaseMessage):
149158
"""

tests/test_schemas.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def test_bug_create_schema(self, fakepublish, bug_create_message, relay):
5252
message.app_icon
5353
== "https://bugzilla.redhat.com/extensions/RedHat/web/css/favicon.ico?v=0"
5454
)
55+
assert message.agent_name == "Doncho Gunchev"
56+
assert message.app_name == "bugzilla2fedmsg"
5557
# broken till we can do email2fas
5658
assert message.usernames == []
5759
assert message.packages == ["selinux-policy"]

0 commit comments

Comments
 (0)