diff --git a/compliance/test_fuzzingclient.py b/compliance/test_fuzzingclient.py index 8235dfb..58c5ea6 100644 --- a/compliance/test_fuzzingclient.py +++ b/compliance/test_fuzzingclient.py @@ -19,28 +19,28 @@ ws.close() for case in range(1, count+1): - url = SERVER + '/runCase?case={0}&agent={1}'.format(case, AGENT) - status = websocket.STATUS_NORMAL - try: - ws = websocket.create_connection(url) - while True: - opcode, msg = ws.recv_data() - if opcode == websocket.ABNF.OPCODE_TEXT: - msg.decode("utf-8") - if opcode in (websocket.ABNF.OPCODE_TEXT, websocket.ABNF.OPCODE_BINARY): - ws.send(msg, opcode) - except UnicodeDecodeError: - # this case is ok. - status = websocket.STATUS_PROTOCOL_ERROR - except websocket.WebSocketProtocolException: - status = websocket.STATUS_PROTOCOL_ERROR - except websocket.WebSocketPayloadException: - status = websocket.STATUS_INVALID_PAYLOAD - except Exception as e: - # status = websocket.STATUS_PROTOCOL_ERROR - print(traceback.format_exc()) - finally: - ws.close(status) + url = SERVER + '/runCase?case={0}&agent={1}'.format(case, AGENT) + status = websocket.STATUS_NORMAL + try: + ws = websocket.create_connection(url) + while True: + opcode, msg = ws.recv_data() + if opcode == websocket.ABNF.OPCODE_TEXT: + msg.decode("utf-8") + if opcode in (websocket.ABNF.OPCODE_TEXT, websocket.ABNF.OPCODE_BINARY): + ws.send(msg, opcode) + except UnicodeDecodeError: + # this case is ok. + status = websocket.STATUS_PROTOCOL_ERROR + except websocket.WebSocketProtocolException: + status = websocket.STATUS_PROTOCOL_ERROR + except websocket.WebSocketPayloadException: + status = websocket.STATUS_INVALID_PAYLOAD + except Exception as e: + # status = websocket.STATUS_PROTOCOL_ERROR + print(traceback.format_exc()) + finally: + ws.close(status) print("Ran {} test cases.".format(case)) url = SERVER + '/updateReports?agent={0}'.format(AGENT)