Skip to content

Commit

Permalink
Use the new InvalidStatus.code instead of checking str(exception).
Browse files Browse the repository at this point in the history
  • Loading branch information
cjerdonek committed Jul 22, 2017
1 parent f76bb15 commit 1c8362f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions websockets/test_client_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 1c8362f

Please sign in to comment.