def test_websocket_session (launch): with launch ("./examples/websocket.py") as engine: aquests.configure (1, callback = assert_status) websocket = "ws://127.0.0.1:30371" aquests.ws (websocket + "/websocket/echo4", "I'm a Websocket", callback = assert_status2) aquests.ws (websocket + "/websocket/echo4", "I'm a Websocket", callback = assert_status3) aquests.fetchall ()
def make_example_testset(): if os.path.isfile(r"D:\apps\skitai\tests\examples"): jpg = open( os.path.join(r"D:\apps\skitai\tests\examples", "statics", "reindeer.jpg"), "rb") aquests.upload("http://127.0.0.1:5000/upload", { "username": "******", "file1": jpg }) aquests.get("http://127.0.0.1:5000/") aquests.get("http://127.0.0.1:5000/members/", auth=('admin', '1111')) aquests.get("http://127.0.0.1:5000/redirect1") aquests.rpc("http://127.0.0.1:5000/rpc2/").add_number(1, 2) aquests.ws("ws://127.0.0.1:5000/websocket/echo-single", "Hello Skitai")
def test_ws(): aquests.ws("ws://127.0.0.1:5000/websocket/echo", "I'm a Websocket") aquests.fetchall()