Example #1
0
    def test_close(self):
        mock_sock = mock.MagicMock()
        connection = ServerSocketConnection(mock_sock)
        connection.send_message = mock.MagicMock()

        connection.close()

        assert mock_sock.close.call_count == 1
        assert connection.send_message.call_count == 1
        assert connection.send_message.call_args[0] == ('',)
Example #2
0
    def test_close(self):
        mock_sock = mock.MagicMock()
        connection = ServerSocketConnection(mock_sock)
        connection.send_message = mock.MagicMock()

        connection.close()

        assert mock_sock.close.call_count == 1
        assert connection.send_message.call_count == 1
        assert connection.send_message.call_args[0] == ('', )