def test_bad_environ(self):
     wsgi = async_eventlet.WebSocketWSGI(None)
     environ = {'foo': 'bar'}
     start_response = 'bar'
     with pytest.raises(RuntimeError):
         wsgi(environ, start_response)
 def test_wsgi_call(self, _WebSocketWSGI):
     _WebSocketWSGI.__call__ = lambda e, s: 'data'
     environ = {'eventlet.input': mock.MagicMock()}
     start_response = 'bar'
     wsgi = async_eventlet.WebSocketWSGI(None)
     assert wsgi(environ, start_response) == 'data'
예제 #3
0
 def test_bad_environ(self):
     wsgi = async_eventlet.WebSocketWSGI(None)
     environ = {'foo': 'bar'}
     start_response = 'bar'
     self.assertRaises(RuntimeError, wsgi, environ, start_response)