Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2��j�3��l�SSKrSSKrSSKrSSKJr SSKJr SSKJr SSKJr SSKJ	r	 "SS5r4g)	�N)�command)�
eventsequence)�hooks)�core)�scriptc�L�\rSrSrSrSSS.SjrSrSrS	rS5r	Sr6SrS
rg)�context�z�7A context for testing addons, which sets up the mitmproxy.ctx module so8handlers can run as they would within mitmproxy. The context also9provides a number of helper methods for common testing scenarios.10NT)�options�loadcorec�8�SUl[R"5nU=(d [11RR5n[12RRXS9UlURRUlU(a8URRR[R"55 UH(nURRRU5 M* g![a SUl[R"5nN�f=f)NFT)�13event_loop)�	owns_loop�asyncio�get_running_loop�RuntimeError�new_event_loop�	mitmproxyr�Options�master�Master�addons�addr�Core)�selfrrr�loop�as      �\D:\code\apps\devtools\python\user_packages\Python313\site-packages\mitmproxy/test/taddons.py�__init__�context.__init__s������	,��+�+�-�D�14�8�Y�.�.�6�6�8���&�&�-�-�g�-�G����{�{�*�*�����K�K���"�"�4�9�9�;�/��A��K�K���"�"�1�%����	,�!�D�N��)�)�+�D�	,�s�C0�0&D�Dc��U$)N�)rs r�	__enter__�context.__enter__%s����c���UR(aMURRR5(d$URRR	5 g)NF)rrr�	is_closed�close)r�exc_type�	exc_value�	tracebacks    r�__exit__�context.__exit__(s:���>�>�$�+�+�"8�"8�"B�"B�"D�"D��K�K�"�"�(�(�*�r%c���# �[R"U5HCnURRR	X5IShv�N UR15(dMC g gN7f)zT16Cycles the flow through the events for the flow. Stops if the flow17is intercepted.18N)r�iteraterr�invoke_addon�intercepted)r�addon�f�evts    r�cycle�
context.cycle.sI���19!�(�(��+�C��+�+�$�$�1�1�%�=�=�=��}�}�}��,�=�s�AA#�A!�A#�A#c���XRR;a%URRRU5 URR	UR5SS9 U(aURR"S0UD6 OBURRRU[R"[555 SSS5 g!,(df   g=f)z�20A helper for testing configure methods. Modifies the registered21Options object with the given keyword arguments, then calls the22configure method on the addon with the updated value.23T)�reraiseNr")rr�registerr�rollback�keys�update�invoke_addon_syncr�
ConfigureHook�set)rr2�kwargss   r�	configure�context.configure8s������*�*�*��K�K���'�'��.�
�\�\�
"�
"�6�;�;�=�$�
"�
?�����#�#�-�f�-����"�"�4�4�U�E�<O�<O�PS�PU�<V�W�	@�
?�
?�s
�'A'C�24C%c�t�[R"US5nUR(aURS$S$)z;25Loads a script from path, and returns the enclosed addon.26FrN)r�Scriptr)r�path�scs   rr�context.scriptFs-���]�]�4��
'��!�y�y�r�y�y��|�2�d�2r%c�|�[R"URRSU5nUR	U5$)z27Invoke a command function with a list of string arguments within a command context, mimicking the actual command environment.28ztest.command)r�Commandr�commands�call)r�func�args�cmds    rr�context.commandMs.���o�o�d�k�k�2�2�N�D�I���x�x��~�r%)rrr)
�__name__�29__module__�__qualname__�__firstlineno__�__doc__rr#r,r5rArr�__static_attributes__r"r%rr	r	s2���)-�t�&�$���X�3�r%r	)r�mitmproxy.masterr�mitmproxy.optionsrrr�mitmproxy.addonsrrr	r"r%r�<module>rYs)������#��!�#�F�Fr%
codekingpro/portable-devtools · Team Ai