Skip to content

Commit

Permalink
Change base transport's publish_status() to expect a component argument
Browse files Browse the repository at this point in the history
  • Loading branch information
justinvdm committed Oct 15, 2015
1 parent 707ac66 commit 80f8314
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vumi/transports/base.py
Expand Up @@ -168,11 +168,11 @@ def publish_delivery_report(self, user_message_id, delivery_status, **kw):
delivery_status=delivery_status,
event_type='delivery_report', **kw)

def publish_status(self, status, **kw):
def publish_status(self, component, status, **kw):
"""
Helper method for publishing a status message.
"""
msg = TransportStatus(status=status, **kw)
msg = TransportStatus(component=component, status=status, **kw)
return self.connectors[self.status_connector_name].publish_status(msg)

def _send_failure_eb(self, f, message):
Expand Down
5 changes: 4 additions & 1 deletion vumi/transports/tests/test_base.py
Expand Up @@ -120,7 +120,10 @@ def test_publish_status(self):
'transport_name': 'foo'
})

msg = yield transport.publish_status('major', reasons=['many lemons'])
msg = yield transport.publish_status(
'a', 'major', reasons=['many lemons'])

self.assertEqual(msg['component'], 'a')
self.assertEqual(msg['status'], 'major')
self.assertEqual(msg['reasons'], ['many lemons'])

Expand Down

0 comments on commit 80f8314

Please sign in to comment.