<s> import logging <EOL> import unittest <EOL> import six <EOL> if six . PY3 : <EOL> from unittest import mock <EOL> else : <EOL> import mock <EOL> from engineio import async_eventlet <EOL> class TestAsyncEventlet ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> logging . getLogger ( '<STR_LIT>' ) . setLevel ( logging . NOTSET ) <EOL> def test_bad_environ ( self ) : <EOL> wsgi = async_eventlet . WebSocketWSGI ( None ) <EOL> environ = { '<STR_LIT:foo>' : '<STR_LIT:bar>' } <EOL> start_response = '<STR_LIT:bar>' <EOL> self . assertRaises ( RuntimeError , wsgi , environ , start_response ) <EOL> @ mock . patch ( '<STR_LIT>' , <EOL> return_value = '<STR_LIT:data>' ) <EOL> def test_wsgi_call ( self , _WebSocketWSGI ) : <EOL> _WebSocketWSGI . __call__ = lambda e , s : '<STR_LIT:data>' <EOL> environ = { '<STR_LIT>' : None } <EOL> start_response = '<STR_LIT:bar>' <EOL> wsgi = async_eventlet . WebSocketWSGI ( None ) <EOL> self . assertEqual ( wsgi ( environ , start_response ) , '<STR_LIT:data>' ) </s>
