Skip to content

Commit

Permalink
rename close() to disconnect() for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jul 4, 2015
1 parent a77a6f0 commit 12cc283
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions engineio/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def send(self, sid, data, binary=None):
self._get_socket(sid).send(packet.Packet(packet.MESSAGE, data=data,
binary=binary))

def close(self, sid=None):
"""Close a client connection.
def disconnect(self, sid=None):
"""Disconnect a client.
:param sid: The session id of the client to close. If this parameter
is not given, then all clients are closed.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_close_one_socket(self):
s = server.Server()
mock_socket = mock.MagicMock()
s.clients['foo'] = mock_socket
s.close('foo')
s.disconnect('foo')
mock_socket.close.assert_called_once()
self.assertNotIn('foo', s.clients)

Expand All @@ -63,7 +63,7 @@ def test_close_all_sockets(self):
for sid in ['foo', 'bar', 'baz']:
mock_sockets[sid] = mock.MagicMock()
s.clients[sid] = mock_sockets[sid]
s.close()
s.disconnect()
for socket in six.itervalues(mock_sockets):
socket.close.assert_called_once()
self.assertEqual(s.clients, {})
Expand Down

0 comments on commit 12cc283

Please sign in to comment.