Skip to content

Commit

Permalink
Merge branch 'feature/issue-990-rename-unbound-status-event-to-bindin…
Browse files Browse the repository at this point in the history
…g-for-smpp' into develop
  • Loading branch information
justinvdm committed Oct 19, 2015
2 parents 81e4b4a + 1146029 commit c568eab
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion vumi/transports/smpp/protocol.py
Expand Up @@ -93,7 +93,7 @@ def connectionMade(self):
system_type=self.config.system_type,
interface_version=self.config.interface_version,
address_range=self.config.address_range)
yield self.service.on_connection()
yield self.service.on_smpp_binding()

@inlineCallbacks
def bind(self,
Expand Down
4 changes: 2 additions & 2 deletions vumi/transports/smpp/smpp_service.py
Expand Up @@ -198,8 +198,8 @@ def on_smpp_bind(self):
yield self.transport.on_smpp_bind()

@inlineCallbacks
def on_connection(self):
yield self.transport.on_connection()
def on_smpp_binding(self):
yield self.transport.on_smpp_binding()

@inlineCallbacks
def on_smpp_bind_timeout(self):
Expand Down
10 changes: 5 additions & 5 deletions vumi/transports/smpp/smpp_transport.py
Expand Up @@ -299,8 +299,8 @@ def _reject_for_invalid_address(self, message, field):
message['message_id'], u'Invalid %s: %s' % (field, message[field]))

@inlineCallbacks
def on_connection(self):
yield self.publish_status_unbound()
def on_smpp_binding(self):
yield self.publish_status_binding()

@inlineCallbacks
def on_smpp_bind(self):
Expand Down Expand Up @@ -329,12 +329,12 @@ def on_smpp_bind_timeout(self):
def on_connection_lost(self, reason):
yield self.publish_status_connection_lost(reason)

def publish_status_unbound(self):
def publish_status_binding(self):
return self.publish_status(
status='major',
component='smpp',
type='unbound',
message='Connected but not bound')
type='binding',
message='Binding')

def publish_status_bound(self):
return self.publish_status(
Expand Down
6 changes: 3 additions & 3 deletions vumi/transports/smpp/tests/test_protocol.py
Expand Up @@ -39,12 +39,12 @@ def get_static_config(self):
def get_config(self):
return self._static_config

def on_connection(self):
pass

def on_connection_lost(self, reason):
self.paused = True

def on_smpp_binding(self):
pass

def on_smpp_bind(self):
self.paused = False

Expand Down
2 changes: 1 addition & 1 deletion vumi/transports/smpp/tests/test_smpp_service.py
Expand Up @@ -45,7 +45,7 @@ def pause_connectors(self):
def unpause_connectors(self):
self.paused = False

def on_connection(self):
def on_smpp_binding(self):
pass

def on_smpp_bind(self):
Expand Down
8 changes: 4 additions & 4 deletions vumi/transports/smpp/tests/test_smpp_transport.py
Expand Up @@ -1678,8 +1678,8 @@ def test_connect_status(self):
[msg] = self.tx_helper.get_dispatched_statuses()
self.assertEqual(msg['status'], 'major')
self.assertEqual(msg['component'], 'smpp')
self.assertEqual(msg['type'], 'unbound')
self.assertEqual(msg['message'], 'Connected but not bound')
self.assertEqual(msg['type'], 'binding')
self.assertEqual(msg['message'], 'Binding')

@inlineCallbacks
def test_bind_status(self):
Expand Down Expand Up @@ -1799,7 +1799,7 @@ def test_smsc_throttle_reconnect_status(self):

[msg1, msg2, msg3] = self.tx_helper.get_dispatched_statuses()

self.assertEqual(msg1['type'], 'unbound')
self.assertEqual(msg1['type'], 'binding')
self.assertEqual(msg2['type'], 'bound')

self.assertEqual(msg3['status'], 'minor')
Expand Down Expand Up @@ -1859,7 +1859,7 @@ def test_tps_throttle_reconnect_status(self):

[msg1, msg2, msg3] = self.tx_helper.get_dispatched_statuses()

self.assertEqual(msg1['type'], 'unbound')
self.assertEqual(msg1['type'], 'binding')
self.assertEqual(msg2['type'], 'bound')

self.assertEqual(msg3['status'], 'minor')
Expand Down

0 comments on commit c568eab

Please sign in to comment.