(self)
| 10 | |
| 11 | class ExceptionsTests(unittest.TestCase): |
| 12 | def test_str(self): |
| 13 | for exception, exception_str in [ |
| 14 | ( |
| 15 | WebSocketException("something went wrong"), |
| 16 | "something went wrong", |
| 17 | ), |
| 18 | ( |
| 19 | ConnectionClosed( |
| 20 | Close(CloseCode.NORMAL_CLOSURE, ""), |
| 21 | Close(CloseCode.NORMAL_CLOSURE, ""), |
| 22 | True, |
| 23 | ), |
| 24 | "received 1000 (OK); then sent 1000 (OK)", |
| 25 | ), |
| 26 | ( |
| 27 | ConnectionClosed( |
| 28 | Close(CloseCode.GOING_AWAY, "Bye!"), |
| 29 | Close(CloseCode.GOING_AWAY, "Bye!"), |
| 30 | False, |
| 31 | ), |
| 32 | "sent 1001 (going away) Bye!; then received 1001 (going away) Bye!", |
| 33 | ), |
| 34 | ( |
| 35 | ConnectionClosed( |
| 36 | Close(CloseCode.NORMAL_CLOSURE, "race"), |
| 37 | Close(CloseCode.NORMAL_CLOSURE, "cond"), |
| 38 | True, |
| 39 | ), |
| 40 | "received 1000 (OK) race; then sent 1000 (OK) cond", |
| 41 | ), |
| 42 | ( |
| 43 | ConnectionClosed( |
| 44 | Close(CloseCode.NORMAL_CLOSURE, "cond"), |
| 45 | Close(CloseCode.NORMAL_CLOSURE, "race"), |
| 46 | False, |
| 47 | ), |
| 48 | "sent 1000 (OK) race; then received 1000 (OK) cond", |
| 49 | ), |
| 50 | ( |
| 51 | ConnectionClosed( |
| 52 | None, |
| 53 | Close(CloseCode.MESSAGE_TOO_BIG, ""), |
| 54 | None, |
| 55 | ), |
| 56 | "sent 1009 (message too big); no close frame received", |
| 57 | ), |
| 58 | ( |
| 59 | ConnectionClosed( |
| 60 | Close(CloseCode.PROTOCOL_ERROR, ""), |
| 61 | None, |
| 62 | None, |
| 63 | ), |
| 64 | "received 1002 (protocol error); no close frame sent", |
| 65 | ), |
| 66 | ( |
| 67 | ConnectionClosedOK( |
| 68 | Close(CloseCode.NORMAL_CLOSURE, ""), |
| 69 | Close(CloseCode.NORMAL_CLOSURE, ""), |
nothing calls this directly
no test coverage detected