Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
routing_test.cpython-313.pyc34 linesDownload Raw Back to __pycache__
1�

2��j�#���SSKJrJrJrJr SSKJrJrJrJ	r	J3r4Jr SSKJ
r
 SSKJrJrJr SSKJr SSKr"SS\	5r"S	S5\
5r0r"SS\5r"S
S\5r"SS\	5r"SS\
5rSr\"S5r\"S5r"SS\5r"SS\
5r "SS\5r!"SS\
5r""SS\
5r#g) �)�HTTPHeaders�HTTPMessageDelegate�HTTPServerConnectionDelegate�ResponseStartLine)�HostMatches�PathMatches�ReversibleRouter�Router�Rule�6RuleRouter)�AsyncHTTPTestCase)�Application�	HTTPError�RequestHandler)�
WSGIContainerNc��\rSrSrSrSrg)�BasicRouter�"c�D�"SS[5nU"UR5$)Nc� �\rSrSrSrSrSrg)�1BasicRouter.find_handler.<locals>.MessageDelegate�$c��Xlg�N��7connection��selfrs  �_D:\code\apps\devtools\python\user_packages\Python313\site-packages\tornado/test/routing_test.py�__init__�:BasicRouter.find_handler.<locals>.MessageDelegate.__init__%���",��c��URR[SSS5[SS05S5 URR	5 g�N�HTTP/1.1���OK�Content-Length�2�OK)r�
write_headersrr�finish�rs rr-�8BasicRouter.find_handler.<locals>.MessageDelegate.finish(sC�����-�-�%�j�#�t�<��!1�3� 7�8���8���&�&�(r#rN��__name__�9__module__�__qualname__�__firstlineno__r r-�__static_attributes__�r#r�MessageDelegater$s��
-�
)r#r7)rr)r�request�kwargsr7s    r�find_handler�BasicRouter.find_handler#s"��10	)�1�11	)��w�1�1�2�2r#r6N)r1r2r3r4r:r5r6r#rrr"s��
3r#rc� �\rSrSrSrSrSrg)�BasicRouterTestCase�3c��[5$r)rr.s r�get_app�BasicRouterTestCase.get_app4s12���}�r#c�^�URS5nURURS5 g)Nz/any_requestr+��fetch�assertEqual�body�r�responses  r�test_basic_router�%BasicRouterTestCase.test_basic_router7s$���:�:�n�-���������.r#r6N)r1r2r3r4r@rIr5r6r#rr=r=3s���/r#r=c��\rSrSrSrSrg)�GetResource�?c�^�U[;a[S5eUR[U5 g)N�)�	resourcesrr-�r�paths  r�get�GetResource.get@s$���y� ��C�.� ����I�d�O�$r#r6N�r1r2r3r4rSr5r6r#rrLrL?s��%r#rLc��\rSrSrSrSrg)�PostResource�Gc�>�URR[U'gr)r8rFrPrQs  r�post�PostResource.postHs���,�,�+�+�	�$�r#r6N)r1r2r3r4rZr5r6r#rrWrWGs��,r#rWc� �\rSrSrSrSrSrg)�HTTPMethodRouter�Lc��Xlgr��app)rras  rr �HTTPMethodRouter.__init__Ms���r#c��URS:Xa[O[nURR	XUR13/S9$)N�GET)�	path_args)�methodrLrWra�get_handler_delegaterR)rr8r9�handlers    rr:�HTTPMethodRouter.find_handlerPs4��!(���5�!8�+�l���x�x�,�,�W�'�,�,��,�X�Xr#r`N)r1r2r3r4r r:r5r6r#rr]r]Ls
���Yr#r]c� �\rSrSrSrSrSrg)�HTTPMethodRouterTestCase�Uc�(�[[55$r)r]rr.s rr@� HTTPMethodRouterTestCase.get_appVs����
�.�.r#c�J�URSSSS9nURURS5 URS5nURURS5 URS5nURURS5 URURS5 g)	Nz/post_resource�POST�data)rfrFr'z
/get_resourcerOsdata)rDrE�coderFrGs  r�test_http_method_router�0HTTPMethodRouterTestCase.test_http_method_routerYs����:�:�.�v�F�:�K���������,��:�:�o�.���������,��:�:�.�/���������,��������0r#r6N)r1r2r3r4r@rsr5r6r#rrkrkUs��/�	1r#rkc�,^�"U4SjS[5nU$)Nc�">�\rSrSrU4SjrSrg)�#_get_named_handler.<locals>.Handler�fc��>�URRRS5b+URURRSS-5 UR	TS-URT5-5 g)N�app_namez: )�application�settingsrS�writer-�reverse_url)r�argsr9�handler_names   �rrS�'_get_named_handler.<locals>.Handler.getgsc������(�(�,�,�Z�8�D��14�15�4�+�+�4�4�Z�@�4�G�H��K�K��t�+�d�.>�.>�|�.L�L�Mr#r6NrU)r�s�r�Handlerrwfs���	N�	Nr#r�)r)r�r�s` r�_get_named_handlerr�es���N�.�N��Nr#�
first_handler�second_handlerc�:^�\rSrSrU4SjrSrSrSrSrU=r	$)�CustomRouter�tc�0>�[TU]5 0Ulgr)�superr �routes)r�	__class__s �rr �CustomRouter.__init__us���
������r#c�:�URRU5 gr)r��update)rr�s  r�16add_routes�CustomRouter.add_routesys�������6�"r#c��URUR;a,URURup4URX5$gr)rRr�rg)rr8r9rarhs     rr:�CustomRouter.find_handler|s<���<�<�4�;�;�&��;�;�w�|�|�4�L�C��+�+�G�=�=�'r#c�2�SU-nX0R;aU$S$)N�/�r�)r�namer�handler_paths    rr~�CustomRouter.reverse_url�s���T�z��+�{�{�:�|�D��Dr#r�)17r1r2r3r4r r�r:r~r5�
__classcell__)r�s@rr�r�ts����#�>�18E�Er#r�c� �\rSrSrSrSrSrg)�CustomRouterTestCase�c�^�[5m"U4SjS[5nU"SS9nU"SS9nTRU[4U[4U[4S.5 T$)Nc�">�\rSrSrU4SjrSrg)�7CustomRouterTestCase.get_app.<locals>.CustomApplication�c�*>�TR"U/UQ76$r)r~)rr�r�routers   �rr~�CCustomRouterTestCase.get_app.<locals>.CustomApplication.reverse_url�s����)�)�$�6��6�6r#r6N)r1r2r3r4r~r5)r�s�r�CustomApplicationr��s
���
7�
7r#r��app1)rz�app2)�/first_handler�/second_handler�/first_handler_second_app)r�rr��FirstHandler�
SecondHandler)rr�r�r�r�s    @rr@�CustomRouterTestCase.get_app�s^������	7��	7�!�&�1�� �&�1�����#'��"6�$(�-�#8�.2�L�-A�
�	19��
r#c��URS5nURURS5 URS5nURURS5 URS5nURURS5 g)Nr�s#app1: first_handler: /first_handlerr�s%app2: second_handler: /second_handlerr�s#app2: first_handler: /first_handlerrCrGs  r�test_custom_router�'CustomRouterTestCase.test_custom_router�sn���:�:�.�/��������(N�O��:�:�/�0��������(P�Q��:�:�9�:��������(N�Or#r6N)r1r2r3r4r@r�r5r6r#rr�r��s
���(Pr#r�c��\rSrSrSrSrg)�ConnectionDelegate�c�0�"SS[5nU"U5$)Nc� �\rSrSrSrSrSrg)�9ConnectionDelegate.start_request.<locals>.MessageDelegate�c��Xlgrrrs  rr �BConnectionDelegate.start_request.<locals>.MessageDelegate.__init__�r"r#c���SnURR[SSS5[S[	[U55055 URR
U5 URR5 g)Nr+r&r'r(r))rr,rr�str�lenr}r-)r�
response_bodys  rr-�@ConnectionDelegate.start_request.<locals>.MessageDelegate.finish�sa�� %�
����-�-�%�j�#�t�<��!1�3�s�=�7I�3J� K�L�����%�%�m�4����&�&�(r#rNr0r6r#rr7r��s��
-�
)r#r7)r)r�server_conn�request_connr7s    r�
start_request� ConnectionDelegate.start_request�s��	)�1�	)��|�,�,r#r6N)r1r2r3r4r�r5r6r#rr�r��s��-r#r�c� �\rSrSrSrSrSrg)�RuleRouterTest�c�\�[5nSn[5nURSU[S5405 UR	S[S5[
S5S0S4/4[[
S	5U5[[
S5[S20S9[[
S5U5S
[54/5 U$)Nc���URR[SSS5[SS055 URR	S5 URR5 gr%)rr,rrr}r-)r8s r�request_callable�0RuleRouterTest.get_app.<locals>.request_callable�sX�����,�,�!�*�c�4�8��-�s�3�4�
�
���$�$�U�+����%�%�'r#�/nested_handler�nested_handlerz.*�www.example.comr�z'tornado.test.routing_test.SecondHandlerr�z21/.*handlerr�)r��/request_callable�/connection_delegate)22rr�r�r��add_handlersrrrr�r�)rrar�r�s    rr@�RuleRouterTest.get_app�s����m��	(�������
��&8�9I�&J� K�L�	23�	���� � 1�2�(�(8�9�E��,�	��24��[��.��7��[�!1�2�L��W��[�!4�5�7G�H�'�);�)=�>�
�	25�*�26r#c�|�URS5nURURS5 URSSS0S9nURURS5 URS5nURURS5 URS	5nURURS275 URS5nURURS5 URS
5nURURS5 URS5nURURS285 g)Nr�sfirst_handler: /first_handler�Hostr�)�headersssecond_handler: /first_handlerr�snested_handler: /nested_handlerz/nested_not_found_handlerrOr�r+r��/404)rDrErFrrrGs  r�test_rule_based_router�%RuleRouterTest.test_rule_based_router�s���:�:�.�/��������(H�I��:�:�.��AR�8S�:�T��������(I�J��:�:�/�0��������(J�K��:�:�9�:���������,��:�:�4�5���������.��:�:�1�2���������.��:�:�f�%���������,r#r6N)r1r2r3r4r@r�r5r6r#rr�r��s
��%�N-r#r�c�,�\rSrSrSrSrSrSrSrg)�WSGIContainerTestCase��c	��[UR5n"SS[5n[[	S5[SU0S4/54[	S5U4/5$)Nc��\rSrSrSrSrg)�.WSGIContainerTestCase.get_app.<locals>.Handler��c�D�URURS55 g)N�tornado)r-r~)rrr9s   rrS�2WSGIContainerTestCase.get_app.<locals>.Handler.get�s�����D�,�,�Y�7�8r#r6NrUr6r#rr�r��s��
9r#r�z29/tornado.*�
/tornado/testr��/wsgi)r�wsgi_apprrrr)rr�r�s   rr@�WSGIContainerTestCase.get_app�sc�� ����/��	9�n�	9�� ��-��"2�G�R��!K� L�M���W�%�x�0�
�30�	31r#c��U"S/5 S/$)Nz200 OK�WSGIr6)r�environ�start_responses   rr��WSGIContainerTestCase.wsgi_apps���x��$��y�r#c��URS5nURURS5 URS5nURURS5 g)Nr�s
/tornado/testr�r�rCrGs  r�test_wsgi_container�)WSGIContainerTestCase.test_wsgi_containersG���:�:�o�.��������(8�9��:�:�g�&���������0r#c�^�URS5nURURS5 g)Nr�rO)rDrErrrGs  r�test_delegate_not_found�-WSGIContainerTestCase.test_delegate_not_founds$���:�:�f�%���������,r#r6N)	r1r2r3r4r@r�r�r�r5r6r#rr�r��s��32�"�1�-r#r�)$�tornado.httputilrrrr�tornado.routingrrr	r33rr�tornado.testingr
�tornado.webrrr�tornado.wsgir�typingrr=rPrLrWr]rkr�r�r�r�r�r�r�r�r6r#r�<module>r�s�������.�>�>�&�
�3�&�3�"/�+�/�
�	�%�.�%�,�>�,�34Y�v�Y�
1�0�
1� �"�/�2��"�#3�4�
�E�#�E�$P�,�P�<-�5�-�$<-�&�<-�~-�-�-r#
codekingpro/portable-devtools · Team Ai