Skip to content

Commit

Permalink
Added tests for "fmn.rule.update"
Browse files Browse the repository at this point in the history
Fixed Bug: fedora-infra#247
  • Loading branch information
codenamesubho committed Apr 23, 2015
1 parent c30b022 commit 22e424d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fedmsg_meta_fedora_infrastructure/fmn.py
Expand Up @@ -42,6 +42,8 @@ def subtitle(self, msg, **config):
if 'fmn.confirmation.update' in msg['topic']:
tmpl = self._("the {changed} of one of {user}'s "
"pending confirmations changed")
elif 'fmn.rule.update' in msg['topic']:
tmpl = self._("{user} updated the {changed} on a fmn {ctx} rule")
elif 'fmn.filter.update' in msg['topic']:
tmpl = self._("{user} updated the {changed} on a fmn {ctx} filter")
elif 'fmn.preference.update' in msg['topic']:
Expand Down
29 changes: 29 additions & 0 deletions fedmsg_meta_fedora_infrastructure/tests/fmn.py
Expand Up @@ -243,6 +243,35 @@ class TestConfirmationUpdateStatus(Base):
}
}

class TestRuleUpdate(Base):
""" Messages of this type are published whenever **a rule
is updated** in the `Fedora Notifications
<https://apps.fedoraproject.org/notifications>`_ app.
"""
expected_title = "fmn.rule.update"
expected_subti = "raveit65 updated the filters on a fmn email rule"
expected_link = "https://apps.fedoraproject.org/notifications/"
expected_icon = "https://apps.fedoraproject.org/img/icons/fedmsg.png"
expected_secondary_icon = (
"https://seccdn.libravatar.org/avatar/"
"15321e38b8a94a429e68a68a0f5029371b987c3aa7a0072326538b65ae54ec7e"
"?s=64&d=retro")
expected_packages = set([])
expected_usernames = set(['raveit65'])
expected_objects = set(['raveit65/email/rule/filters'])
msg = {
"i": 1,
"timestamp": 1427936259.0,
"msg_id": "2015-ca011930-b7ba-4355-a75d-079ffbe88fd2",
"topic": "org.fedoraproject.prod.fmn.rule.update",
"source_version": "0.6.5",
"msg": {
"openid": "raveit65.id.fedoraproject.org",
"changed": "filters",
"context": "email"
}
}


add_doc(locals())

Expand Down

0 comments on commit 22e424d

Please sign in to comment.