%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python2.7/site-packages/tornado/test/
Upload File :
Create Path :
Current File : //lib64/python2.7/site-packages/tornado/test/websocket_test.pyo

�
��L]c@�sddlmZmZmZmZddlZddlmZddlm	Z	ddl
mZmZddl
mZmZddlmZmZmZmZddlmZdd	lmZmZdd
lmZy ddlZddlmZWnek
rej��nXddlm Z m!Z!m"Z"ydd
lm#Z#Wnek
r\dZ#nXde fd��YZ%de%fd��YZ&de%fd��YZ'de%fd��YZ(defd��YZ)de%fd��YZ*de%fd��YZ+defd��YZ,de,fd��YZ-d e.fd!��YZ/d"e/fd#��YZ0d$e0e,fd%��YZ1d&e0e,fd'��YZ2d(e0e,fd)��YZ3d*e/e,fd+��YZ4d,e.fd-��YZ5d.e5ej6fd/��YZ7ej8e#dkd0�d1e5ej6fd2��Y�Z9dS(3i(tabsolute_importtdivisiontprint_functiontwith_statementN(tFuture(tgen(t	HTTPErrortHTTPRequest(tgen_logtapp_log(tAsyncHTTPTestCasetgen_testtbind_unused_portt	ExpectLog(tunittest(tApplicationtRequestHandler(tu(t_websocket_mask_python(tWebSocketHandlertwebsocket_connecttWebSocketError(tspeedupstTestWebSocketHandlercB�s,eZdZdd�Zd�Zd�ZRS(s�Base class for testing handlers that exposes the on_close event.

    This allows for deterministic cleanup of the associated socket.
    cC�s||_||_dS(N(tclose_futuretcompression_options(tselfRR((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt
initialize&s	cC�s|jS(N(R(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pytget_compression_options*scC�s |jj|j|jf�dS(N(Rt
set_resultt
close_codetclose_reason(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyton_close-sN(t__name__t
__module__t__doc__tNoneRRR (((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR!s	tEchoHandlercB�seZd�ZRS(cC�s|j|t|t��dS(N(t
write_messaget
isinstancetbytes(Rtmessage((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt
on_message2s(R!R"R*(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR%1stErrorInOnMessageHandlercB�seZd�ZRS(cC�sdddS(Nii((RR)((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR*7s(R!R"R*(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR+6st
HeaderHandlercB�seZd�ZRS(cC�sTy|jd�td��Wntk
r0nX|j|jjjdd��dS(Ni�sdid not get expected exceptionsX-Testt(t
set_statust	ExceptiontRuntimeErrorR&trequesttheaderstget(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pytopen<s

(R!R"R4(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR,;stNonWebSocketHandlercB�seZd�ZRS(cC�s|jd�dS(Ntok(twrite(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR3Hs(R!R"R3(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR5GstCloseReasonHandlercB�seZd�ZRS(cC�st|_|jdd�dS(Ni�tgoodbye(tFalseton_close_calledtclose(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR4Ms	(R!R"R4(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR8LstAsyncPrepareHandlercB�s#eZejd��Zd�ZRS(cc�stjVdS(N(Rtmoment(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pytprepareSscC�s|j|�dS(N(R&(RR)((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR*Ws(R!R"Rt	coroutineR?R*(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR=RstWebSocketBaseTestCasecB�s/eZejdd��Zejd��ZRS(cc�s6td|j�|fd|�V}tj|��dS(Nsws://127.0.0.1:%d%sR(Rt
get_http_portRtReturn(RtpathRtws((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt
ws_connect\s
cc�s|j�|jVdS(s�Close a websocket connection and wait for the server side.

        If we don't wait here, there are sometimes leak warnings in the
        tests.
        N(R<R(RRE((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR<cs
N(R!R"RR@R$RFR<(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyRA[st
WebSocketTestcB�s"eZd�Zd�Zed��Zd�Zed��Zed��Zed��Z	ed��Z
ed��Zed	��Zed
��Z
ed��Zed��Zed
��Zed��Zed��Zed��Zed��Zed��Zed��ZRS(cC�s�t�|_tdttd|j�fdtfdttd|j�fdttd|j�fdttd|j�fdt	td|j�fg�S(Ns/echoRs/non_wss/headers
/close_reasons/error_in_on_messages/async_prepare(
RRRR%tdictR5R,R8R+R=(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pytget_appos	cC�s&|jd�}|j|jd�dS(Ns/echoi�(tfetchtassertEqualtcode(Rtresponse((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_http_request}scc�sL|jd�V}|jd�|j�V}|j|d�|j|�VdS(Ns/echothello(RFR&tread_messageRKR<(RRERM((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_websocket_gen�s


c�s�td�j�d�jd�j��j�j�}|jd�|j�j��j�j�}�j|d��j	j
�fd��|j��j�dS(Nsws://127.0.0.1:%d/echotio_looptcallbackROc�s
�j�S(N(tstop(tf(R(sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt<lambda>�s(RRBRRRTtwaittresultR&RPRKRtadd_done_callbackR<(RRERM((RsA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_websocket_callbacks�s

cc�sR|jd�V}|jddt�|j�V}|j|d�|j|�VdS(Ns/echoshello �tbinary(RFR&tTrueRPRKR<(RRERM((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_binary_message�s

cc�sX|jd�V}|jtd��|j�V}|j|td��|j|�VdS(Ns/echoshello \u00e9(RFR&RRPRKR<(RRERM((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_unicode_message�s

cc�sb|jd�V}|jd�ttd��|j�V}WdQX|j|d�|j|�VdS(Ns/error_in_on_messageROsUncaught exception(RFR&R
R	RPtassertIsR$R<(RRERM((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_error_in_on_message�s
cc�s@|jt��}|jd�VWdQX|j|jjd�dS(Ns	/notfoundi�(tassertRaisesRRFRKt	exceptionRL(Rtcm((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_websocket_http_fail�scc�s(|jt��|jd�VWdQXdS(Ns/non_ws(RaRRF(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_websocket_http_success�scc�sgt�\}}|j�|jt��9ttd��#td|d|jdd�VWdQXWdQXdS(Ns.*sws://127.0.0.1:%d/RRtconnect_timeouti(RR<RatIOErrorR
RRRR(Rtsocktport((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_websocket_network_fail�s

	cc�sJtd|j��V}|jd�|jd�|jj�|jVdS(Nsws://127.0.0.1:%d/echoROtworld(RRBR&tstreamR<R(RRE((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt"test_websocket_close_buffered_data�s


cc�sYttd|j�didd6��V}|j�V}|j|d�|j|�VdS(Nsws://127.0.0.1:%d/headerR2ROsX-Test(RRRBRPRKR<(RRERM((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_websocket_headers�s
cc�sw|jd�V}|j�V}|j|d�|j|jd�|j|jd�|jV\}}|j|d�dS(Ns
/close_reasoni�R9(RFRPR_R$RKRRR(RREtmsgRLtreason((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_server_close_reason�s
cc�sT|jd�V}|jdd�|jV\}}|j|d�|j|d�dS(Ns/echoi�R9(RFR<RRK(RRERLRp((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_client_close_reason�s
cc�s>|jd�V}|jd�|j�V}|j|d�dS(Ns/async_prepareRO(RFR&RPRK(RREtres((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_async_prepare�s

cc�s�|j�}d|}id|d6}tt|d|�d|j�V}|jd�|j�V}|j|d�|j|�VdS(Nsws://127.0.0.1:%d/echoshttp://127.0.0.1:%dtOriginR2RRRO(RBRRRRR&RPRKR<(RRiturlR2RERM((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_check_origin_valid_no_path�s



cc�s�|j�}d|}id|d6}tt|d|�d|j�V}|jd�|j�V}|j|d�|j|�VdS(Nsws://127.0.0.1:%d/echoshttp://127.0.0.1:%d/somethingRuR2RRRO(RBRRRRR&RPRKR<(RRiRvR2RERM((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt!test_check_origin_valid_with_paths



c	c�sy|j�}d|}id|d6}|jt��'}tt|d|�d|j�VWdQX|j|jjd�dS(Nsws://127.0.0.1:%d/echos127.0.0.1:%dRuR2RRi�(	RBRaRRRRRRKRbRL(RRiRvR2Rc((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt%test_check_origin_invalid_partial_urls
c	c�su|j�}d|}idd6}|jt��'}tt|d|�d|j�VWdQX|j|jjd�dS(Nsws://127.0.0.1:%d/echoshttp://somewhereelse.comRuR2RRi�(	RBRaRRRRRRKRbRL(RRiRvR2Rc((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_check_origin_invalid"s

c	c�su|j�}d|}idd6}|jt��'}tt|d|�d|j�VWdQX|j|jjd�dS(Nsws://localhost:%d/echoshttp://subtenant.localhostRuR2RRi�(	RBRaRRRRRRKRbRL(RRiRvR2Rc((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt$test_check_origin_invalid_subdomains1s

(R!R"RIRNRRQRZR]R^R`RdReRjRmRnRqRrRtRwRxRyRzR{(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyRGns(			
	

	tCompressionTestMixincB�s8eZdZd�Zd�Zd�Zed��ZRS(sHello world. Testing 123 123cC�s:t�|_tdttd|jd|j��fg�S(Ns/echoRR(RRRR%RHtget_server_compression_options(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyRIDs
	cC�sdS(N(R$(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR}LscC�sdS(N(R$(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pytget_client_compression_optionsOscc�s�|jdd|j��V}xDtd�D]6}|j|j�|j�V}|j||j�q)W|j|jjt	|j�d�|j|jj
t	|j�d�|j|jj|jj
�|j|�VdS(Ns/echoRi(RFR~trangeR&tMESSAGERPRKtprotocolt_message_bytes_outtlent_message_bytes_intverify_wire_bytest_wire_bytes_int_wire_bytes_outR<(RREtiRM((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyttest_message_sizesRs
##
(R!R"R�RIR}R~RR�(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR|As
			tUncompressedTestMixincB�seZdZd�ZRS(sESpecialization of CompressionTestMixin when we expect no compression.cC�sF|j|dt|j�d�|j|dt|j�d�dS(Niii(RKR�R�(Rtbytes_int	bytes_out((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR�fs!(R!R"R#R�(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR�dstNoCompressionTestcB�seZRS((R!R"(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR�lstServerOnlyCompressionTestcB�seZd�ZRS(cC�siS(N((R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR}rs(R!R"R}(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR�qstClientOnlyCompressionTestcB�seZd�ZRS(cC�siS(N((R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR~ws(R!R"R~(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR�vstDefaultCompressionTestcB�s#eZd�Zd�Zd�ZRS(cC�siS(N((R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR}|scC�siS(N((R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR~scC�sZ|j|dt|j�d�|j|dt|j�d�|j||d�dS(Niiii(t
assertLessR�R�RK(RR�R�((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR��s!!(R!R"R}R~R�(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR�{s		tMaskFunctionMixincB�seZd�ZRS(cC�s�|j|jdd�d�|j|jdd�d�|j|jdd�d�|j|jdd�d	�|j|jd
d�d�|j|jd
d�d�dS(NtabcdR-tbst54321tTVPVPtZXCVt98765432sc`t`olpdts������s������s����ts������(RKtmask(R((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt	test_mask�s(R!R"R�(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR��stPythonMaskFunctionTestcB�seZd�ZRS(cC�s
t||�S(N(R(RR�tdata((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR��s(R!R"R�(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR��ss#tornado.speedups module not presenttCythonMaskFunctionTestcB�seZd�ZRS(cC�stj||�S(N(Rtwebsocket_mask(RR�R�((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR��s(R!R"R�(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyR��s(:t
__future__RRRRt	tracebackttornado.concurrentRttornadoRttornado.httpclientRRttornado.logRR	ttornado.testingR
RRR
ttornado.test.utilRttornado.webRRttornado.utilRttornado.websocketRtImportErrort	print_excRRRRR$RR%R+R,R5R8R=RARGtobjectR|R�R�R�R�R�R�tTestCaseR�tskipIfR�(((sA/usr/lib64/python2.7/site-packages/tornado/test/websocket_test.pyt<module>sN""



	�#

Zerion Mini Shell 1.0