From 1c8362f3151bef835ee743736a93a3daea551f01 Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Fri, 21 Jul 2017 19:48:28 -0700 Subject: [PATCH] Use the new InvalidStatus.code instead of checking str(exception). --- websockets/test_client_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/websockets/test_client_server.py b/websockets/test_client_server.py index 54a11693..a0aa97d0 100644 --- a/websockets/test_client_server.py +++ b/websockets/test_client_server.py @@ -272,9 +272,9 @@ def handshake(self, *args, **kwargs): self.start_server(klass=Protocol) try: - with self.assertRaises(InvalidHandshake) as cm: + with self.assertRaises(InvalidStatus) as cm: self.start_client(path='invalid') - self.assertEqual(str(cm.exception), 'Bad status code: 404') + self.assertEqual(cm.exception.code, 404) self.assertFalse(State.handshake_called) # Check that our overridden handshake() is working correctly. self.start_client(path='valid')