Skip to content

Commit

Permalink
Fixed auto_reconnect test.
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo13 committed Jan 16, 2017
1 parent 780d357 commit b4f16db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 2 additions & 4 deletions circuits/node/node.py
Expand Up @@ -93,15 +93,13 @@ def add(self, connection_name, hostname, port, **kwargs):
defined, function or method to call for
check if event is allowed for sending.
**Default:** ``None`` (no firewall)
:type receive_event_firewall: function
:type receive_event_firewall: method
:param send_event_firewall: An optional keyword argument which if
:param send_event_firewall: An optional keyword argument which if
defined, setfunction or method to call to
check if event is allowed for executing
**Default:** ``None`` (no firewall)
:type send_event_firewall: function
:type send_event_firewall: method
:type send_event_firewall: method
:return: Channel used on client event.
:rtype: str
Expand Down
14 changes: 14 additions & 0 deletions tests/node/test_server.py
Expand Up @@ -67,9 +67,23 @@ def test_auto_reconnect(app, watcher, manager):
# close server
app.fire(close(), app.channel)
assert watcher.wait('closed', channel=app.channel)
watcher.clear()

# client gets an unreachable
assert watcher.wait('connect', channel=chan)
assert watcher.wait('unreachable', channel=chan)
watcher.clear()

# start a new server
app = Node(port=app.bind[1], server_ip=app.bind[0])
app.register(manager)
assert watcher.wait('ready', channel=app.channel)
watcher.clear()

assert watcher.wait('connected', channel=chan)

client.unregister()
app.unregister()


def test_server_send_all(app, watcher, manager):
Expand Down

0 comments on commit b4f16db

Please sign in to comment.