Coverage for /pythoncovmergedfiles/medio/medio/src/aiohttp/aiohttp/http_websocket.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

7 statements  

1"""WebSocket protocol versions 13 and 8.""" 

2 

3from ._websocket.helpers import WS_KEY, ws_ext_gen, ws_ext_parse 

4from ._websocket.models import ( 

5 WS_CLOSED_MESSAGE, 

6 WS_CLOSING_MESSAGE, 

7 WebSocketError, 

8 WSCloseCode, 

9 WSHandshakeError, 

10 WSMessage, 

11 WSMessageBinary, 

12 WSMessageClose, 

13 WSMessageClosed, 

14 WSMessageClosing, 

15 WSMessageContinuation, 

16 WSMessageDecodeText, 

17 WSMessageError, 

18 WSMessageNoDecodeText, 

19 WSMessagePing, 

20 WSMessagePong, 

21 WSMessageText, 

22 WSMessageTextBytes, 

23 WSMsgType, 

24) 

25from ._websocket.reader import WebSocketReader 

26from ._websocket.writer import WebSocketWriter 

27 

28# Messages that the WebSocketResponse.receive needs to handle internally 

29_INTERNAL_RECEIVE_TYPES = frozenset( 

30 (WSMsgType.CLOSE, WSMsgType.CLOSING, WSMsgType.PING, WSMsgType.PONG) 

31) 

32 

33 

34__all__ = ( 

35 "WS_CLOSED_MESSAGE", 

36 "WS_CLOSING_MESSAGE", 

37 "WS_KEY", 

38 "WebSocketReader", 

39 "WebSocketWriter", 

40 "WSMessage", 

41 "WSMessageDecodeText", 

42 "WSMessageNoDecodeText", 

43 "WebSocketError", 

44 "WSMsgType", 

45 "WSCloseCode", 

46 "ws_ext_gen", 

47 "ws_ext_parse", 

48 "WSMessageError", 

49 "WSHandshakeError", 

50 "WSMessageClose", 

51 "WSMessageClosed", 

52 "WSMessageClosing", 

53 "WSMessagePong", 

54 "WSMessageBinary", 

55 "WSMessageText", 

56 "WSMessageTextBytes", 

57 "WSMessagePing", 

58 "WSMessageContinuation", 

59)