403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.217.51
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/__pycache__/test_bdb.cpython-313.opt-1.pyc
�

��i;���h�SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	J
r
 SSKJrJ
r
 SSKJr SSKJr SSKJr "SS	\5r"S
S\5r"SS
\5r"SS\5rSrSrSr"SS\R45r"SS\5r"SS5rS/Sjr\
S5r\SS4Sjr Sr!\!S-r"Sr#Sr$S r%S!r&"S"S#\RN5r("S$S%\(5r)"S&S'\(5r*"S(S)\(5r+"S*S+\(5r,"S,S-\RN5r-\.S.:Xa\R^"5 gg)0a8Test the bdb module.

A test defines a list of tuples that may be seen as paired tuples, each
pair being defined by 'expect_tuple, set_tuple' as follows:

    ([event, [lineno[, co_name[, eargs]]]]), (set_type, [sargs])

* 'expect_tuple' describes the expected current state of the Bdb instance.
  It may be the empty tuple and no check is done in that case.
* 'set_tuple' defines the set_*() method to be invoked when the Bdb
  instance reaches this state.

Example of an 'expect_tuple, set_tuple' pair:

    ('line', 2, 'tfunc_main'), ('step', )

Definitions of the members of the 'expect_tuple':
    event:
        Name of the trace event. The set methods that do not give back
        control to the tracer [1] do not trigger a tracer event and in
        that case the next 'event' may be 'None' by convention, its value
        is not checked.
        [1] Methods that trigger a trace event are set_step(), set_next(),
        set_return(), set_until() and set_continue().
    lineno:
        Line number. Line numbers are relative to the start of the
        function when tracing a function in the test_bdb module (i.e. this
        module).
    co_name:
        Name of the function being currently traced.
    eargs:
        A tuple:
        * On an 'exception' event the tuple holds a class object, the
          current exception must be an instance of this class.
        * On a 'line' event, the tuple holds a dictionary and a list. The
          dictionary maps each breakpoint number that has been hit on this
          line to its hits count. The list holds the list of breakpoint
          number temporaries that are being deleted.

Definitions of the members of the 'set_tuple':
    set_type:
        The type of the set method to be invoked. This may
        be the type of one of the Bdb set methods: 'step', 'next',
        'until', 'return', 'continue', 'break', 'quit', or the type of one
        of the set methods added by test_bdb.Bdb: 'ignore', 'enable',
        'disable', 'clear', 'up', 'down'.
    sargs:
        The arguments of the set method if any, packed in a tuple.
�N)�contextmanager)�islice�repeat)�
import_helper)�	os_helper)�
patch_listc��\rSrSrSrg)�BdbException�A�N)�__name__�
__module__�__qualname__�__firstlineno__�__static_attributes__r��"C:\Python313\\Lib\test\test_bdb.pyr
r
As��trr
c��\rSrSrSrSrg)�BdbError�Bz!Error raised by the Bdb instance.rN�r
rrr�__doc__rrrrrrBs��Errc��\rSrSrSrSrg)�BdbSyntaxError�CzSyntax error in the test case.rNrrrrrrCs��$Hrrc��\rSrSrSrSrg)�BdbNotExpectedError�DzUnexpected result.rNrrrrrrDs��)Arrc�@�[RR5 g�N)�_bdb�
Breakpoint�clearBreakpointsrrr�reset_Breakpointr$Ls���O�O�$�$�&rc��[RRVs/sH
o(dMUPM nnU(dgSnUH�nU(dSnSnUR(aSOSnUR(aSOSnWS	UR
XEURUR[RRUR5UR4--
nUR(aUS
UR<3-
nUS-
nM� W$s snf)N�Fz!BpNum Temp Enb Hits Ignore Where
Tzyes zno  �yeszno z%-5d %s %s %-4d %-6d at %s:%dz
	stop only if �
)r!r"�
bpbynumber�	temporary�enabled�number�hits�ignore�os�path�basename�file�line�cond)�bp�bp_list�header_added�info�disp�enabs      r�info_breakpointsr;Os���!�_�_�7�7�>�7�r�2�r�7�G�>����L����7�D��L����v�6���
�
�u����0��Y�Y��B�G�G�R�Y�Y��W�W�%�%�b�g�g�.����9�9�	:���7�7��R�W�W�6�6�D�������K��%?s
�
D�Dc�p^�\rSrSrSrU4SjrS
U4SjjrU4SjrSrSr	Sr
S	rS
rSr
SrU=r$)�Bdb�dz$Extend Bdb to enhance test coverage.c�2>�SUl[TU]	XU5$r )�	currentbp�super�trace_dispatch)�self�frame�event�arg�	__class__s    �rrB�Bdb.trace_dispatchgs�������w�%�e�C�8�8rc�z>�[U[5(auU[:Xa[5nO%[R
"USS5nURn[XV5nURn	U	RnU	RnU	Rn[TU]5XUXES9n
[U
[5(a[U
5eU
$)N���)r*r4�funcname)�
isinstance�str�__file__�globals�	importlib�
import_module�__dict__�eval�__code__�co_filename�co_firstlineno�co_namerA�	set_breakr)rC�filename�linenor*r4rK�globals_�module�func�code�resrGs           �rrX�
Bdb.set_breakks�����h��$�$��8�#�"�9��"�0�0��#�2��?��!�?�?����+�D��=�=�D��'�'�H��(�(�F��|�|�H��g���I�&*� �?���c�3����3�-���
rc�>�[TU]X5uUlUlURURSUlURUR4$�Nr)rA�	get_stack�stack�indexrD)rC�f�trGs   �rrc�
Bdb.get_stacksG���!&��!2�1�!8���
�D�J��Z�Z��
�
�+�A�.��
��z�z�4�:�:�%�%rc�P�URU5nU=RS-
slg)z8Increment the ignore count of Breakpoint number 'bpnum'.�N)�get_bpbynumberr.�rC�bpnumr5s   r�
set_ignore�Bdb.set_ignore�s��
�
 �
 ��
'��
�	�	�Q��	rc�4�URU5nSUlg)NT�rkr+rls   r�
set_enable�Bdb.set_enable�s��
�
 �
 ��
'����
rc�4�URU5nSUlg)NFrqrls   r�set_disable�Bdb.set_disable�s��
�
 �
 ��
'����
rc�J�URX5nU(a[U5egr )�clear_breakr)rC�fnamerZ�errs    r�	set_clear�
Bdb.set_clear�s$�����u�-����3�-��rc��UR(d[S5eU=RS-slURURSUlg)zMove up in the frame stack.zOldest framerjrN)rerrdrD�rCs r�set_up�
Bdb.set_up�s:���z�z��>�*�*��
�
�a��
��Z�Z��
�
�+�A�.��
rc���URS-[UR5:Xa[S5eU=RS-
slURURSUlg)zMove down in the frame stack.rjzNewest framerN)re�lenrdrrDr~s r�set_down�Bdb.set_down�sK���:�:��>�S����_�,��>�*�*��
�
�a��
��Z�Z��
�
�+�A�.��
r)r@rDrerd)FNN)r
rrrrrBrXrcrnrrrur{rr�r�
__classcell__�rGs@rr=r=dsB���.�9�AE���(&�
�
�� �
/�/�/rr=c�^�\rSrSrSrSU4SjjrSrU4SjrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSSjrSrSrSrU=r$)�Tracer�z$A tracer for testing the bdb module.c�v>�[TU]US9 XlX0lUbSU-OSUlUR5 g)N��skipzDry-run results for %s:)rA�__init__�
expect_set�dry_run�header�	init_test)rCr�r�r��	test_caserGs     �rr��Tracer.__init__�sA���
���d��#�$���� �,�1�9�<�26�	
�����rc���SUlSUlSUl[[	UR
SSS55Ul[[	UR
SSS55Ulg)Nr�rj)�
cur_except�
expect_set_no�breakpoint_hits�listrr��
expected_list�set_listr~s rr��Tracer.init_test�sP��������#���!�&����!�T�1�"E�F����V�D�O�O�Q��a�@�A��
rc��>�URbUReUS:Xa[TU]	XU5nU$[TU]	XU5$![anXPlURsSnA$SnAff=f�N�	exception)r�rArBr
)rCrDrErFr_�erGs      �rrB�Tracer.trace_dispatch�ss���
�?�?�&��/�/�!��K��
+��g�,�U�3�?���
�
�7�)�%��<�<��	 �
+�"#���*�*�*��
+�s�A�
A*�A%�A*�%A*c�v�URU5(dgURSX5 UR5 g)N�call)�	stop_here�
process_event�next_set_method)rCrD�
argument_lists   r�	user_call�Tracer.user_call�s2���~�~�e�$�$�����6�5�8����rc�8�URSU5 UR(aPUR(a?[5R	S5nURS5Hn[
SU-5 M UR5 SUlUR5 g)Nr3r(z  )	r�r�r�r;�strip�split�print�delete_temporariesr�)rCrDr8r3s    r�	user_line�Tracer.user_line�ss�����6�5�)��<�<�D�0�0�#�%�+�+�D�1�D��
�
�4�(���d�T�k�"�)����!�#������rc�H�URSX5 UR5 g)N�return�r�r�)rCrD�return_values   r�user_return�Tracer.user_return�s�����8�U�9����rc�T�X lURSU5 UR5 gr�)�exc_infor�r�)rCrDr�s   r�user_exception�Tracer.user_exception�s#�� �
����;��.����rc�H�URSU5 UR5 g)N�opcoder�)rCrDs  r�user_opcode�Tracer.user_opcode�s�����8�U�+����rc�.�UR/nX"4Ulgr )r@r�)rCrFr6s   r�do_clear�Tracer.do_clear�s���>�>�"�� '�1��rc�v�UR(a(URSHnURU5 M gg�Nrj)r��clear_bpbynumber)rC�ns  rr��Tracer.delete_temporaries�s3������)�)�!�,���%�%�a�(�-� rc��U=RS-
slURRS5UlURRS5Ulg![a [SUR-5ef=f)Nrjrz-expect_set list exhausted, cannot pop item %d)r�r��pop�expect�
IndexErrorrr��	set_tupler~s r�pop_next�Tracer.pop_next�sw�����a���	$��,�,�0�0��3�D�K�
���*�*�1�-����	�	$�%�?��"�"�#�$�
$�	$�s� A�#A;c	��SnUS:XaURSnURX$5 URb'UR(dUR/nU/4UlXlUR5 UR(aURUR5 gUR(a0URURSUS5 UR5 US;aURS5 g[UR5S:�GacUS:Xa�URSupg[UR55nUR(dUR!SUR"-5 URX�RSS	5 URUV	s/sHo�U	PM	 sn	URSV	s/sHn	UR%U	5R&PM  sn	S
5 UR[U5URSS5 gUS:XaW[)URSURS5(d+UR!S
UR"UR4-5 ggggs sn	fs sn	f)Nr�r�rzWrong event type)r�r��r3z(No breakpoints hit at expect_set item %dzBreakpoint numbers do not matchzWrong breakpoint hit countrjzWrong temporary breakpointsz/Wrong exception at expect_set item %d, got '%s')r�rcr@r�rEr�r��print_stater�r��check_equal�check_lno_name�check_expect_max_sizer��sorted�keys�raise_not_expectedr�rkr-rL)
rCrErD�args�tbr6�bps�temporaries�bpnumsr�s
          rr��Tracer.process_event�s6�����K�����q�!�B����u�!��>�>�%�d�.B�.B��~�~�&�G�$+�R�=�D� ��
��
�
���<�<����T�[�[�)���;�;����T�[�[��^�U�4F�G����!��&�&��&�&�q�)�
����
��
!����#'�;�;�q�>� ������
�+���+�+��+�+�B��*�*�+�,�� � ��)=�)=�a�)@�5�7�� � �&�!9�&�Q�a�&�&�!9�!�1�1�!�4�6�4���(�(��+�0�0�4�6�0�2�� � ���!4�d�6J�6J�1�6M�1�3��+�%�!�$�-�-��"2�D�K�K��N�C�C��+�+�I��+�+�T�]�]�;�<�=�D�&�#"��":��6s� I7�%I<
c�P�X:XagURSX0RU4-5 g)Nz"%s at expect_set item %d, got '%s')r�r�)rC�expected�result�msgs    rr��Tracer.check_equal1s1�������� D�!$�&8�&8�&� A�!B�	Crc�$�[UR5nUS:�a0UR5nURURSUS5 US:�a?URURSURR
RS5 gg)z+Check the line number and function co_name.rjzWrong line numberr�zWrong function nameN)r�r��lno_abs2relr�rD�f_coderW)rC�srZs   rr��Tracer.check_lno_name7sz���������q�5��%�%�'�F����T�[�[��^�V�5H�I��q�5����T�[�[��^�T�Z�Z�->�->�-F�-F�0E�
G�rc��[UR5U:�a'[SUR<SUR<35eg)NzInvalid size of the z expect tuple: )r�r�rrE)rC�sizes  rr��Tracer.check_expect_max_sizeAs7���t�{�{��d�"� �"&�*�*�d�k�k�";�<�
<�#rc�
�URURRR5nURRnXR[
5:Xa%X RRR-
S-$U$r�)�canonicrDr�rU�f_linenorNrV�rCryrZs   rr��Tracer.lno_abs2relFsh�����T�Z�Z�.�.�:�:�;�����$�$�����X�.�.��*�*�+�+�:�:�:�Q�>�	<�4:�	<rc��U(aNURU5UR[5:Xa&URRRU-S-
$U$r�)r�rNrDr�rVr�s   r�lno_rel2abs�Tracer.lno_rel2absLsJ���4�<�<��.�$�,�,�x�2H�H��
�
�!�!�0�0�6�9�A�=�	��	rc�T�UR5nURRRnSURX4-nUR
(aySnUR
SH2nUS:waUS-
nXE<SUR
U5R<3-
nM4 US-
nSU-S-[UR
S5-S	-nUSU--
nO/URS
:XaUSURSR--
nUS-
nURS5[UR5-S
-$)Nz('%s', %d, '%s'�{rz, z: �}�(rj�)r�z), � �,)
r�rDr�rWrEr�rkr-rMr�r
�ljustr�)rCrZrW�stater�r�s      r�	get_state�Tracer.get_stateQs ���!�!�#���*�*�#�#�+�+��!�T�Z�Z��$A�A������C��)�)�!�,���#�:��4�K�C��1�d�&9�&9�!�&<�&A�&A�B�B��-�
�3�J�C���)�d�"�S��)=�)=�a�)@�%A�A�C�G�C��T�C�Z��E�
�Z�Z�;�
&��T�D�M�M�!�,�5�5�5�5�E�
�����{�{�2���T�^�^�!4�4�s�:�:rc��Ub%URS:Xa[5 [U5 [SURUR54-5 g)Nrjz%d: %s)r�r�r�)rCr�s  rr��Tracer.print_statecs@����$�"4�"4��"9��G��&�M�
�h�$�,�,�d�n�n�.>�?�?�@rc��US-
nUS[UR5--
nUSUR5--
n[U5e)Nr(z  Expected: %s
z  Got:      )rMr�r�r�rCr�s  rr��Tracer.raise_not_expectedisE���t����!�C����$4�4�4���~���� 0�0�0��!�#�&�&rc�v�URSn[UR5S:XaURSOSn[USU-5nUS;aU"5 gUS;aU"UR5 gUS:XaPSnU(a3UR	URR
RUS5nU"URU5 gU(aUS;dUS	;a�US
;a/UtpTnUR	XT5nXT/nURU5 U"U6 OUS;aU"U6 O
US	;aU"5 SUlUR5 UR(aUR5 O2UR(aUR5 URS5 UR5 g[!S
UR-5e)Nrr�rj�set_)�step�	stepinstr�continue�quit)�nextr��until)�break�clearr.�enable�disable)�up�down)r
r)r.rr
r�z"%s" is an invalid set_tuple)r�r��getattrrDr�r�rU�extendrEr�r�r�r�r�r�r�r)rC�set_typer��
set_methodrZry�remains       rr��Tracer.next_set_methodos����>�>�!�$��$'����$7�1�$<�t�~�~�a� �$���T�6�H�#4�5�
��@�@��L��
�+�
+��t�z�z�"��
��
 ��F���)�)�$�*�*�*;�*;�*G�*G�*.�q�'�3���t�z�z�6�*��
�X�"/�/�3;�~�3M��-�-�)-�&����)�)�%�8��������F�#��D�!��<�<��D�!��^�+����D�J��M�M�O��|�|�� � �"��;�;��'�'�)��*�*�1�-�� � �"� �!?�!%���"0�1�
1r)r�r�r�rEr�r�r�r�r�r�r�r�)NFNr )r
rrrrr�r�rBr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�s@rr�r��sy���.��B�=�$����
�2�
)�
.�0=�dC�G�<�
<��
;�$A�'�01�01rr�c�2�\rSrSrSrSSjrSrS	SjrSrg)
�	TracerRuni�zAProvide a context for running a Tracer instance with a test case.Nc��XlURUl[URUURUR	5S9UlSUlg)N)r�r�r�)r�r�r�r��id�tracer�_original_tracer)rCr�r�s   rr��TracerRun.__init__�sB��"�� �(�(����Y�1�1��%)�\�\�Y�\�\�^�M��� $��rc�b�[5 [R"5UlUR$r )r$�sys�gettracerrr~s r�	__enter__�TracerRun.__enter__�s ���� #�������{�{�rc���[5 [R"UR5 SnURR
(aCUS-
nUSURR--
nU[URR
5-
nUb�[[U5(a}[U[5(ahUR(aWURSnU(aUSU--
nUR(a[U5 gURR!U5 U(a9UR(a[U5 gURR!U5 gg)Nr&z+All paired tuples have not been processed, zthe last one was number %d
rr(T)r$r�settracerrr�r��repr�
issubclassrrL�
BaseExceptionr�r�r�r��fail)rC�type_�value�	traceback�	not_empty�err_msgs      r�__exit__�TracerRun.__exit__�s�������T�*�*�+��	��;�;����F�F�I��8��+�+�3�3�4�
5�I���d�k�k�2�2�3�3�I����,?��!G�!G��%��/�/�E�J�J��*�*�Q�-����t�i�/�/�G��<�<��'�N���N�N�'�'��0���|�|��i� ����#�#�I�.�	r)rr�r�rr )NNN)	r
rrrrr�r r-rrrrrr�s��K�%��/rrc�r�SnSS/nURU5 [5nSUlSUl[	U"[S5[
U555Ul[U5 [XRS9nUR[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)	a�Run a test and print the dry-run results.

'modules':  A dictionary mapping module names to their source code as a
            string. The dictionary MUST include one module named
            'test_module' with a main() function.
'set_list': A list of set_type tuples to be run on the module.

For example, running the following script outputs the following results:

*****************************   SCRIPT   ********************************

from test.test_bdb import run_test, break_in_func

code = '''
    def func():
        lno = 3

    def main():
        func()
        lno = 7
'''

set_list = [
            break_in_func('func', 'test_module.py'),
            ('continue', ),
            ('step', ),
            ('step', ),
            ('step', ),
            ('quit', ),
        ]

modules = { 'test_module': code }
run_test(modules, set_list)

****************************   results   ********************************

1: ('line', 2, 'tfunc_import'),    ('next',),
2: ('line', 3, 'tfunc_import'),    ('step',),
3: ('call', 5, 'main'),            ('break', ('test_module.py', None, False, None, 'func')),
4: ('None', 5, 'main'),            ('continue',),
5: ('line', 3, 'func', ({1: 1}, [])), ('step',),
  BpNum Temp Enb Hits Ignore Where
  1     no   yes 1    0      at test_module.py:2
6: ('return', 3, 'func'),          ('step',),
7: ('line', 7, 'main'),            ('step',),
8: ('return', 7, 'main'),          ('quit',),

*************************************************************************

c3�n# �[U5n[U5nUv� Uv� M ![a gf=f7fr )r�
StopIteration)�a�b�x�ys    r�gen�run_test.<locals>.gensA���	����G����G������	��
�	��	�s�5�!%�
2�5�2�5�r�rTc��gr rrrr�<lambda>�run_test.<locals>.<lambda>s��trrr�N)r�BaseTestCaser�rr�r�iterr��create_modulesr�runcall�tfunc_import)�modulesr�r�r6�sl�testrs       r�run_testrE�s���f��j�	!�B��I�I�h���>�D��D�L��D�G��3�v�b�z�4��8�4�5�D�O�	��	 �
�t�
'�6��N�N�<�(�(�
!�	 �
'�
'��
!�	 �s$�&
B(�0B�B(�
B%	�!B(�(
B6c	#��# �[R"5 [RR	[
R"55 UHYnUS-n[USSS9nUR[R"X55 SSS5 [R"U5 M[ [R"5 Sv� UHn[R "U5 M [RR#5 SSS5 g!,(df   N�=f!UHn[R "U5 M [RR#5 f=f!,(df   g=f7f)N�.py�wzutf-8)�encoding)r�temp_cwdrr0�appendr/�getcwd�open�write�textwrap�dedent�	linecache�
checkcacherP�invalidate_cachesr�forgetr�)rB�mryrfs    rr?r?s����	�	�	�	�������	�	��$�	����E�	���%��w�7�1��G�G�H�O�O�G�J�7�8�8��$�$�U�+�	�

�'�'�)�����$�$�Q�'���H�H�L�L�N�
�	�
8�7�����$�$�Q�'���H�H�L�L�N��
�	�sL�E/�3E�D�!(D�	;D�=E�	E/�
D�D�?E�E�
E,�(E/Fc��SUSX#U44$)Nr
r)rKryr*r4s    r�
break_in_funcrW+s���U�D�)�8�<�<�<r�test_module_for_bdbrGc�,�SSKnUR5 grb)rX�main)rXs rrArA0s������rc�<�Sn[5 [5 SnSnSng)Nr����)�tfunc_first�tfunc_second��lnos r�
tfunc_mainrc4s ��
�C��M��N�
�C�
�C�
�Crc��SnSnSng)Nr�r��rras rr_r_<s��
�C�
�C�
�Crc��Sng)Nr�rras rr`r`As��
�Crc�&�\rSrSrSr\rSSjrSrg)r=iDzBase class for all tests.Nc�&�URU5Ser )�failureExceptionrs  rr'�BaseTestCase.failIs���#�#�C�(�d�2rrr )r
rrrrr�r'rrrrr=r=Ds��#��G�3rr=c��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSr\"\R&5S5rSrSrSrSrg)�
StateTestCaseiNz;Test the step, next, return, until and quit 'set_' methods.c��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)�r3r�rcr9�r3r�rcr9�r�rjr_r9�r3r�r_�r�r�rr@rc�rCrs  r�	test_step�StateTestCase.test_stepQ�,��
����t�_���N�N�:�&��_�_��	�4�
Ac�&�SHhnURUS9 SSSSSS[S44S	S
SSSS
S
0/44U4SS/Ul[U5nUR	[
5 SSS5 SSS5 Mj g!,(df   N=f!,(df   M�=f)N)rr�rrnr9rorpr
r�)�Nonerjr_�rr3r_rj�r3rer_rr)�subTestrNr�rr@rc)rCrrs   r� test_step_next_on_last_statement�.StateTestCase.test_step_next_on_last_statement[s���(�H����x��0�-�Z�-�Z�.�g��RS�}�=U�.�^��Q�
��1��r�{�;�h�\�.�Z�
#����t�_���N�N�:�.�%�1�0�)�%�_��1�0�s#�0B�A0�B�0
A>�:B�
B	c��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)rn)r)r�r�rcr8rorrrsrts  r�test_stepinstr�StateTestCase.test_stepinstris,��
���
�t�_���N�N�:�&��_�_�rxc��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)
rnr9ror8�r3rercr9)r�rjr`r9)r3r�r`rrrsrts  r�	test_next�StateTestCase.test_nextr�,��
����t�_���N�N�:�&��_�_�rxc���Sn[U0n[U5 /SQUl[U5nUR	[
5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)N�9
            def main():
                lno = 3
        )�r3r�rAr8�r3r�rArr)�TEST_MODULEr?r�rr@rA�rCr^rBrs    r�test_next_over_import�#StateTestCase.test_next_over_import}s[���� ��'��
�G�
$��D�O��4��F����|�,�!�%�
$�
!���%�
$�s"�A#�A�A#�
A 	�A#�#
A1c��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)rnr9ror9rpr8rqrrrsrts  r�test_next_on_plain_statement�*StateTestCase.test_next_on_plain_statement�s,��
����t�_���N�N�:�&��_�_�rxc��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)
rnr9ror9rp�r�r{r�rcr8r�rrrsrts  r�test_next_in_caller_frame�'StateTestCase.test_next_in_caller_frame�s,��
����t�_���N�N�:�&��_�_�rxc��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)rnr9ror9rpr9rq�r��r�rer_r9r�rrrsrts  r�test_return�StateTestCase.test_return�s,��
����t�_���N�N�:�&��_�_�rxc��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)
rnr9ror9rpr�r�r�)r�r^rcrrrsrts  r�test_return_in_caller_frame�)StateTestCase.test_return_in_caller_frame�r�rxc��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)
rnr9ror9rpr9rq)r	)rer}rrrsrts  r�
test_until�StateTestCase.test_until�r�rxc	��S[S5SSSSSSS0/44SS	S
/Ul[U5nUR[5 SSS5 g!,(df   g=f)Nrnr_)r{r�rcr|r3r�rj)r	)i'r�rr)rWr�rr@rcrts  r�test_until_with_too_large_count�-StateTestCase.test_until_with_too_large_count�sW��%�]�=�5Q�%�^�
�Q�
��1��r�{�3�5H�(�Z�	
����t�_���N�N�:�&��_�_�s�A�
Ac��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)
rnr9ror9rpr�r�)r	)r])r3r]rcrrrsrts  r�test_until_in_caller_frame�(StateTestCase.test_until_in_caller_frame�r�rxc�H�S[R5[RSS&Sn[U0n[U5 /SQUlSSS[4n[XS9nUR
[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nc3�j# �UH)nURRS5(dM%Uv� M+ g7f)�_frozen_importlibN)r�
startswith)�.0�items  r�	<genexpr>�*StateTestCase.test_skip.<locals>.<genexpr>�s,���
�%�����)�)�*=�>�
�D�%�s�$3�	3r�)r�r9r�rrz
importlib*�	zipimportzencodings.*r�)r�	meta_pathr�r?r�rr@rA)rCr^rBr�rs     r�	test_skip�StateTestCase.test_skip�s���
��
�
�
��
�
�a���� ��'��
�G�
$��D�O�!�+�}�k�J�D��4�+�v����|�,�,�
%�
$�,�+��
%�
$�s#�B�B�1B�
B	�B�
B!c�Z�[S/S9nURURS5S5 g)Nz	anything*r�F)r=�assertIs�is_skipped_module)rC�bdbs  r�test_skip_with_no_name_module�+StateTestCase.test_skip_with_no_name_module�s)����}�%���
�
�c�+�+�D�1�5�9rc��SS/Ul[U5nUR[UR[
5 SSS5 g!,(df   g=f)Nrn)r)r�r�assertRaisesrr@rcrts  r�	test_down�StateTestCase.test_down�s=��
&�z�
����t�_�����h����
�C��_�_���&A�
Ac��/SQUl[U5nUR[5 SSS5 g!,(df   g=f)N)rnr9ror9rpr�r�rrrsrts  r�test_up�StateTestCase.test_uprwrx�r�N)r
rrrrrurr�r�r�r�r�r�r�r�r�r�rrr�r�r�r�r�rrrrrlrlNsn��E�'�/�'�	'�-�
'�'�
'�	'�	'�'�	'���
�
��-��-�2:�D�'rrlc�Z�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrg)�BreakpointTestCaseizTest the breakpoint set method.c��SS/Ul[U5nUR[UR[
5 SSS5 g!,(df   g=f)Nr�)r
)z/non/existent/module.pyrj)r�rr�rr@rArts  r�test_bp_on_non_existent_module�1BreakpointTestCase.test_bp_on_non_existent_modules<��'�)R�
����t�_�����h�����E��_�_�r�c��Sn[U0n[U5 SS[S44/Ul[	U5nUR[UR[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nr�r�r
re)	r�r?�TEST_MODULE_FNAMEr�rr�rr@rAr�s    r�test_bp_after_last_statement�/BreakpointTestCase.test_bp_after_last_statementsu���� ��'��
�G�
$�+�g�8I�1�7M�-N��D�O��4��F��!�!�(�F�N�N�L�I�!�	%�
$�!���	%�
$�s"�A;�&A*�A;�*
A8	�4A;�;
B	c�X�Sn[U0n[U5 S[S[S5S[S[S5SSSSSS	S	0S	/44SSSSS
S	0S
/44S/
Ul[U5nUR
[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)N��
            def func():
                lno = 3

            def main():
                for i in range(2):
                    func()
        r�r]T�r{r�rAr|r3r�rjr�rr�r�r?rWr�r�rr@rAr�s    r�test_temporary_bp�$BreakpointTestCase.test_temporary_bp%s����� ��'��
�G�
$�+�!�&�*;�T�B�+�!�&�*;�T�B�+�>���F�a��U�Q�C�L�1�>���F�a��U�Q�C�L�1�:��D�O��4��F����|�,�!�%�
$�!���%�
$�s$�A
B�#B
�9B�

B	�B�
B)c�x�Sn[U0n[U5 S[S[5S[S[S5SSSSSS	SS
S
0/44SSS
SSSS	SSS
0S/44SSSSS	SS
S0/44S/Ul[U5nUR
[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)N��
            def func():
                lno = 3

            def main():
                for i in range(3):
                    func()
        r�r]r�T)r
�r�r|r3r�rj)rr��r{r�r]�r
�rjr��rr�rrr�r�s    r�test_disabled_temporary_bp�-BreakpointTestCase.test_disabled_temporary_bp<s����� ��'��
�G�
$�+�!�&�*;�<�+�!�&�*;�T�B�+�3E�+�>���F�a��U�B�K�0�3D�#�3E�#�>���F�a��U�Q�C�L�1�3D�#�>���F�a��U�B�K�0�:�
�D�O��4��F����|�,�!�%�
$�!���%�
$�s$�AB+�3B�	B+�
B(	�$B+�+
B9c
� �Sn[U0n[U5 S[S[SS5SSSS	SS
S	0/44S/Ul[U5nUR
[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nz�
            def func(a):
                lno = 3

            def main():
                for i in range(3):
                    func(i)
        r�r]Fza == 2r�r|r3r�rjrrr�r�s    r�test_bp_condition�$BreakpointTestCase.test_bp_conditionXs����� ��'��
�G�
$�+�!�&�*;�U�H�M�+�>���F�a��U�B�K�0�:�	�D�O��4��F����|�,�!�%�
$�!���%�
$��#�1A?�A.�A?�.
A<	�8A?�?
B
c
� �Sn[U0n[U5 S[S[SS5SSSS	SS
S
0/44S/Ul[U5nUR
[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nzk
            def func(a):
                lno = 3

            def main():
                func(0)
        r�r]Fz1 / 0r�r|r3r�rjrrr�r�s    r�)test_bp_exception_on_condition_evaluation�<BreakpointTestCase.test_bp_exception_on_condition_evaluationls����� ��'��
�G�
$�+�!�&�*;�U�G�L�+�>���F�a��U�B�K�0�:�	�D�O��4��F����|�,�!�%�
$�!���%�
$�r�c� �Sn[U0n[U5 S[S[5SSSSSSSS	S
0/44S/Ul[U5nUR
[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nr�r�r]r��r.r�r|r3r�rjr�rrr�r�s    r�test_bp_ignore_count�'BreakpointTestCase.test_bp_ignore_counts����� ��'��
�G�
$�+�!�&�*;�<�+�2C�+�.���F�a��U�B�K�0�*��D�O��4��F����|�,�!�%�
$�!���%�
$�r�c�p�Sn[U0n[U5 S[S[5S[S[5SSSSSSSS	SS
S0/44SS
SSS	SS
S
0/44SSS	SSS
0/44S/Ul[U5nUR
[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nr�r�r]r�r�r�r|r3r�r�rjr�r�rrr�r�s    r� test_ignore_count_on_disabled_bp�3BreakpointTestCase.test_ignore_count_on_disabled_bp�s����� ��'��
�G�
$�+�!�&�*;�<�+�!�&�*;�<�+�2C�+�2D�+�.���F�a��U�B�K�0�2C�#�.���F�a��U�B�K�0�.���F�a��U�B�K�0�*��D�O��4��F����|�,�!�%�
$�!���%�
$�s$�AB'�/B�B'�
B$	� B'�'
B5c�t�Sn[U0n[U5 SS[S44SS[S44SS[S44SSSSS	S
S
0/44SSSS	SS
0/44S[S44SSSSS	SS
0/44S/Ul[	U5nUR[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nz�
            def func():
                lno = 3
                lno = 4

            def main():
                for i in range(3):
                    func()
        r�r
r�r�rer|r3r]rjr)r{rer]r�rr)r�r?r�r�rr@rAr�s    r�test_clear_two_bp_on_same_line�1BreakpointTestCase.test_clear_two_bp_on_same_line�s����� ��'��
�G�
$�+�7�=N�PQ�<R�2S�+�7�=N�PQ�<R�2S�+�7�=N�PQ�<R�2S�+�.���F�a��U�B�K�0�.���F�a��U�B�K�0�7�=N�PQ�<R�2S�#�.���F�a��U�B�K�0�*�	�D�O��4��F����|�,�!�%�
$�!���%�
$�s$�AB)�1B�B)�
B&	�"B)�)
B7c��SS[S44/Ul[U5nUR[UR
[5 SSS5 g!,(df   g=f)Nr�rrj)rNr�rr�rr@rArts  r�test_clear_at_no_bp�&BreakpointTestCase.test_clear_at_no_bp�sD��'�'�H�a�=�)A�
����t�_�����h�����E��_�_�s�&A�
Ac��[5 [5nUR[5nUR	[S5 URUR
5US/05 [5nUR	[S5 UR	[S5 UR	[S5 URUR
5US/05 URUR
5U/SQ05 UR[S5 URUR
5US/05 URUR
5U/SQ05 [5nURUR
5US/05 URUR
5U/SQ05 URUR
5U/SQ05 UR[S5 URUR
5US/05 URUR
5USS/05 URUR
5U/SQ05 [5nUR	[S5 URUR
5US/05 URUR
5USS/05 URUR
5U/SQ05 URUR
5U/SQ05 [5 [5nUR	[S	5 URUR
5US/05 URUR
5USS/05 URUR
5U/SQ05 URUR
5U/SQ05 URUR
5US	/05 g)
Nrjr�r�re)rjr�r�re)r�r�rer\)r�rer\r])r$r=r�rNrX�assertEqual�get_all_breaksrx)rC�db1ry�db2�db3�db4�db5s       r�(test_load_bps_from_previous_Bdb_instance�;BreakpointTestCase.test_load_bps_from_previous_Bdb_instance�s�����e�����H�%���
�
�h��"�����+�+�-���s�|�<��e���
�
�h��"��
�
�h��"��
�
�h��"�����+�+�-���s�|�<�����+�+�-��|�/D�E�����!�$�����+�+�-���s�|�<�����+�+�-��y�/A�B��e������+�+�-���s�|�<�����+�+�-��y�/A�B�����+�+�-��y�/A�B�����!�$�����+�+�-���s�|�<�����+�+�-���1�v��?�����+�+�-��y�/A�B��e���
�
�h��"�����+�+�-���s�|�<�����+�+�-���1�v��?�����+�+�-��y�/A�B�����+�+�-��y�/A�B����e���
�
�h��"�����+�+�-���s�|�<�����+�+�-���1�v��?�����+�+�-��y�/A�B�����+�+�-��y�/A�B�����+�+�-���s�|�<rr�N)r
rrrrr�r�r�r�r�r�r�r�r�r�r�rrrrr�r�s?��)�F�J�-�.-�8-�(-�&-�*-�6-�2F�(=rr�c�$�\rSrSrSrSrSrSrg)�RunTestCasei�z Test run, runeval and set_trace.c���Sn/SQUl[U5nUR[[R
"U5SS55 SSS5 g!,(df   g=f)N�
            lno = 2
        )�r3r��<module>r9�r�r�rrr�<string>�exec�r�r�run�compilerOrP�rCr^rs   r�
test_run_step�RunTestCase.test_run_step�sE����
����t�_���J�J�w�x���t�4�j�&�I�J��_�_���1A�
Ac��Sn[U0n[U5 /SQUlSSKn[	U5nURS[
5[55 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nr�)
)r3rjrr9)r�r�rZr9)r3r�rZr9)r�r�rZr9)r�rjrrrrztest_module_for_bdb.main())r�r?r�rXr�runevalrO�locals)rCr^rBrXrs     r�test_runeval_step�RunTestCase.test_runeval_step	sg���� ��'��
�G�
$��D�O�
'��4��F����;�W�Y���Q�!�%�
$�!���%�
$�s"�A5�$A$�A5�$
A2	�.A5�5
Br�N)r
rrrrrrrrrrr�r��s��*�
K�Rrr�c�<�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�IssuesTestCaseizTest fixed bdb issues.c�$�SnSn[USU0n[U5 S[SS5SSS	S
SSS0/44SS
SSS/
Ul[	U5nUR[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nz�
            from test_module_for_bdb_2 import func
            def main():
                func()
                lno = 5
        z9
            def func():
                lno = 3
        �test_module_for_bdb_2r�r]ztest_module_for_bdb_2.pyr�r|r3r�rjr9)r�r�r])r3r\rZrr)r�r?rWr�rr@rA)rC�code_1�code_2rBrs     r�+test_step_at_return_with_no_trace_in_caller�:IssuesTestCase.test_step_at_return_with_no_trace_in_callers�������

��#�V�
���G�
$�+�!�&�*D�E�+�.���F�a��U�B�K�0�*�%�*�#�*�
�D�O��4��F����|�,�!�%�
$�!���%�
$�s#�/B�	A0�B�0
A>	�:B�
Bc��Sn[U0nSH�nURUS9 [U5 S[S[5SSSS	SS
S
0/44U4/UlUS:Xa(UR
R
SS
S[4SSS/5 OUR
R
SS/5 [U5nUR[5 SSS5 SSS5 SSS5 M� g!,(df   N#=f!,(df   N,=f!,(df   M�=f)Nz�
            def test_gen():
                yield 0
                lno = 4
                return 123

            def main():
                it = test_gen()
                next(it)
                next(it)
                lno = 11
        )rr	r�rzr��test_genr�r|r3r�rjr�r��
rZr9)r�rrZrr�r3rer)r�r~r?rWr�r�rr1rr@rA)rCr^rBrrs     r�#test_next_until_return_in_generator�2IssuesTestCase.test_next_until_return_in_generator=s���
�� ��'��3�H����x��0�#�G�,�3�)�*�6G�H�3�n���J�!�A����<�x�l�	'�D�O� �8�+����.�.�)�2�v�}�E�y�3�z������.�.�4�j�B��#�4��F����|�4�)�%-�1�0�4�()���%-�,��1�0�s;�C;�A;C*�&C	�<C*�C;�
C'
�#C*�*
C8�4C;�;
D
	c�@�Sn[U0n[U5 S[S[5SSSSSSS0/44S	S
S	SS	SS	S
SS[4SSS/Ul[
U5nUR[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nz�
            def test_gen():
                yield 0
                lno = 4
                yield 1
                return 123

            def main():
                for i in test_gen():
                    lno = 10
                lno = 11
        r�rr�r|r3r�rjr8r)r3r\r)r3r]rr��	rZr9)r3�rZrr�	r�r?rWr�r1r�rr@rAr�s    r�'test_next_command_in_generator_for_loop�6IssuesTestCase.test_next_command_in_generator_for_loopfs����� ��'��
�G�
$�+�!�*�.?�@�+����J�!�A����4��'��'��'���a���7��$���D�O��4��F����|�,�!�%�
$�!���%�
$�s$�AB�A>�-B�>
B	�B�
Bc
�8�Sn[U0n[U5 S[S[5SSSSSSS0/44S	S
S	SSS
[4SSS/Ul[
U5nUR[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)N�4
            def test_subgen():
                yield 0
                return 123

            def test_gen():
                x = yield from test_subgen()
                return 456

            def main():
                for i in test_gen():
                    lno = 12
                lno = 13
        r�rr�r|r3r^rjr8)r3�rr�r rZr9�r3�
rZrrr!r�s    r�/test_next_command_in_generator_with_subiterator�>IssuesTestCase.test_next_command_in_generator_with_subiterator�s���
�� ��'��
�G�
$�+�!�*�.?�@�+�.���J�!�A����4�*�'�*��b�&�-�8�*�$�*�	�D�O��4��F����|�,�!�%�
$�!���%�
$�s#�=B�A:�)B�:
B	�B�
Bc
�H�Sn[U0n[U5 S[S[5SSSSSSS0/44S	S
SS[4S	S
S
S[4SSS/Ul[
U5nUR[5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nr%r��test_subgenr�r|r3r�rjr�r�r^rr rZr9r'rrr!r�s    r�1test_return_command_in_generator_with_subiterator�@IssuesTestCase.test_return_command_in_generator_with_subiterator�s���
�� ��'��
�G�
$�+�!�-�1B�C�+�n���M�Q�q�E�2�;�7�l��a��]�;�l��b�&�-�8�j�$�j�	�D�O��4��F����|�,�!�%�
$�!���%�
$�s$�AB�B�1B�
B	�B�
B!c���Sn/SQUl[U5nUR[[R
"U5SS55 SSS5 g!,(df   g=f)Nr�)r�r9rr8rrrrs   r�test_next_to_botframe�$IssuesTestCase.test_next_to_botframe�sE����
����t�_���J�J�w�x���t�4�j�&�I�J��_�_�r
r�N)r
rrrrrrr"r)r-r0rrrrrrs%�� �-�<'5�R-�>-�>-�>Krrc��\rSrSrSrSrg)�TestRegressionsi�c��URS[5R[R"5S455 g)NzWarning: lineno is None)�assertInr=�format_stack_entryr�	_getframer~s r�!test_format_stack_entry_no_lineno�1TestRegressions.test_format_stack_entry_no_lineno�s-���
�
�/��e�.�.��
�
���/F�G�	IrrN)r
rrrr8rrrrr3r3�s��Irr3�__main__r )0rr�r!rr/�unittestrOrPrQ�
contextlibr�	itertoolsrr�test.supportrrr�	Exceptionr
rrrr�r$r;r=r�rrEr?rNrWr�r�rArcr_r`�TestCaser=rlr�r�rr3r
rZrrr�<module>rAsZ��0�d�
�	�����%�$�&�"�#�$�9�#�E�|�E�H�\�H�A�,�A���'��*>/�$�(�(�>/�@{1�S�{1�z-/�-/�^H)�T���� #+�e�$�=�$���%�'�����
�3�8�$�$�3�~'�L�~'�@i=��i=�X R�,� R�DrK�\�rK�jI�h�'�'�I��z���M�M�O�r

Youez - 2016 - github.com/yon3zu
LinuXploit