tests: test for websocket_connect failure

This commit is contained in:
Vadim Semenov 2013-04-02 19:27:26 +04:00
parent a69a43b5ef
commit 1ebd245750
1 changed files with 11 additions and 0 deletions

View File

@ -32,3 +32,14 @@ class WebSocketTest(AsyncHTTPTestCase):
ws.read_message(self.stop)
response = self.wait().result()
self.assertEqual(response, 'hello')
@gen_test
def test_websocket_fail(self):
try:
ws = yield websocket_connect(
'ws://localhost:%d/no_websock' % self.get_http_port(),
io_loop=self.io_loop)
except:
pass
else:
self.fail('Should\'ve caught an Exception')