tests/test_connection.py
raw| 1 | from websockets.protocol import Protocol |
| 2 | |
| 3 | from .utils import DeprecationTestCase |
| 4 | |
| 5 | |
| 6 | class BackwardsCompatibilityTests(DeprecationTestCase): |
| 7 | def test_connection_class(self): |
| 8 | """Connection is a deprecated alias for Protocol.""" |
| 9 | with self.assertDeprecationWarning( |
| 10 | "websockets.connection was renamed to websockets.protocol " |
| 11 | "and Connection was renamed to Protocol" |
| 12 | ): |
| 13 | from websockets.connection import Connection |
| 14 | |
| 15 | self.assertIs(Connection, Protocol) |