I am creating an application using the flask_sockets library. How to check it?
Here is a sample code. I want to write unit tests for:
import flask
from flask import Flask
from flask_sockets import Sockets
app = Flask(__name__)
sockets = Sockets(app)
ws_conns = []
@sockets.route('/echo')
def echo_socket(ws):
ws_conns.append(ws)
while True:
for c in ws_conns:
c.send('hello and goodbye!')
ws_conns.remove(ws)
ws.close()
I am using this code from this git repo .
Akhil source
share