K iNddlZddlZddlZddlmZddlmZddlm Z m Z ddl m Z GddZ Gdd e e ZGd d e e Zy) N) validator) RuleRouter)AsyncHTTPTestCasegen_test) WSGIContainerc0eZdZdZdZdZdZdZdZy) WSGIAppMixinctN)NotImplementedErrorselfs \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/tornado/test/wsgi_test.py get_executorzWSGIAppMixin.get_executors !##c|jtjdd|_fd}t d||j fd||j fd||jfgS)Ng333333?)timeoutc0tt|S)N)executor)rr)apprs rmake_containerz,WSGIAppMixin.get_app..make_containers 3(C Cr/simple/barrier/streaming_barrier)r threadingBarrierbarrierrsimple_wsgi_appbarrier_wsgi_appstreaming_barrier_wsgi_app)rrrs @rget_appzWSGIAppMixin.get_appsz$$&!((C8  DN4+?+?@A^D,A,ABC%~d6U6U'VW   rc d}dg}|||y)Nz200 OK)z Content-Typez text/plain)rstart_responsestatusresponse_headerss r respond_plainzWSGIAppMixin.respond_plain"s:;v/0rc*|j|dgS)N Hello world!)r()renvironr%s rrzWSGIAppMixin.simple_wsgi_app's >*  rc|j| |jj}d|zgS#tj$rdgcYSwxYw)Nsok %dbroken barrierr(rwaitrBrokenBarrierErrorrr+r%ns rr zWSGIAppMixin.barrier_wsgi_app+sU >* " !!#AqL> !++ '%& & 's3A  A c#K|j|d |jj}d|zy#tj$rdYywxYww)Nsok s%dr-r.r1s rr!z'WSGIAppMixin.streaming_barrier_wsgi_app4sW >*   !!#A!)O++ $# # $s%A;AAAAAN) __name__ __module__ __qualname__rr"r(rr r!r$rrr r s $ "1 !"rr c8eZdZdZdZedZedZy)WSGIContainerDummyExecutorTestcyr r$r s rrz+WSGIContainerDummyExecutorTest.get_executor@src^|jd}|j|jdyNrr*fetch assertEqualbodyrresponses r test_simplez*WSGIContainerDummyExecutorTest.test_simpleC$::i( 8rcfK|jjtj|jj |j d|jj |j dd{}|D]}|j|jd y7(w)Nrr- rresetasynciogather http_clientr=get_urlr>r?rrespsresps rtest_concurrent_barrierz6WSGIContainerDummyExecutorTest.test_concurrent_barrierGs nn    " "4<< #; <    " "4<< #; <   ;D   TYY(9 : ;  BB1B/)B1cfK|jjtj|jj |j d|jj |j dd{}|D]}|j|jd y7(w)Nrsok broken barrierrErKs r!test_concurrent_streaming_barrierz@WSGIContainerDummyExecutorTest.test_concurrent_streaming_barrierQs nn    " "4<<0D#E F    " "4<<0D#E F   >D   TYY(< = >  rONr4r5r6rrBrrNrQr$rrr8r8?s49;;>>rr8c8eZdZdZdZedZedZy)WSGIContainerThreadPoolTestc>tjjSr ) concurrentfuturesThreadPoolExecutorr s rrz(WSGIContainerThreadPoolTest.get_executor]s!!4466rc^|jd}|j|jdyr;r<r@s rrBz'WSGIContainerThreadPoolTest.test_simple`rCrc K|jjtj|jj |j d|jj |j dd{}|jddgt|Dcgc]}|jc}y7:cc}ww)Nrok 0ok 1 rrFrGrHrIr=rJr>sortedr?rKs rrNz3WSGIContainerThreadPoolTest.test_concurrent_barrierds nn    " "4<< #; <    " "4<< #; <   '7+V54Q4TYY4Q-RS  5R$BCCC"C5 CCc K|jjtj|jj |j d|jj |j dd{}|jddgt|Dcgc]}|jc}y7:cc}ww)Nrr[r\r]rKs rrQz=WSGIContainerThreadPoolTest.test_concurrent_streaming_barrierms nn    " "4<<0D#E F    " "4<<0D#E F   '7+V54Q4TYY4Q-RS  5Rr_NrRr$rrrTrT\s879TTTTrrT)rGconcurrent.futuresrVrwsgiref.validatertornado.routingrtornado.testingrr tornado.wsgirr r8rTr$rrrfsE&&7&00f>\3D>:T,0ATr