403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.224
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/python3/dist-packages/breezy/bzr/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/breezy/bzr/tests/__pycache__/test_weave.cpython-313.pyc
�

p��gpV����SrSSKJr SSKJr SSKJr SSKJr SSK	J
r
JrJr SS	K
JrJr S
SKJrJr S/rSS
/r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"S S!\5r"S"S#\5r"S$S%\5r"S&S'\5r "S(S)\5r!"S*S+\5r""S,S-\5r#"S.S/\5r$"S0S1\5r%"S2S3\5r&"S4S5\5r'"S6S7\5r("S8S9\5r)"S:S;\5r*"S<S=\5r+"S>S?\5r,"S@SA\
5r-"SBSC\5r."SDSE\5r/gF)Gztest suite for weave algorithm.�)�BytesIO)�pformat�)�errors)�
sha_string�)�Weave�WeaveFormatError�WeaveInvalidChecksum)�
read_weave�write_weave�)�TestCase�TestCaseInTempDirsHello worlds
A second linec��\rSrSrSrSrg)�TestBase�&c�^�SSKJn U"5n[X5 URS5 [	U5nX:wa�URS5 URS5 URUR
55 URS5 URSURUR:H-5 URSRUR55 URSRUR55 URS5 URS5 gg)	z+Check the weave k can be written & re-read.r)�
TemporaryFilezserialized weave:�zparents: %sz
         {!r}zread/write check failedN)
�tempfilerr
�seekr�log�read�_parents�format�fail)�self�kr�tf�k2s     �=/usr/lib/python3/dist-packages/breezy/bzr/tests/test_weave.py�check_read_write�TestBase.check_read_write's���*�
�_���A��
����
�
��^���7��G�G�A�J��H�H�(�)��H�H�R�W�W�Y���H�H�R�L��H�H�]�a�j�j�B�K�K�&?�@�A��H�H�_�+�+�A�J�J�7�8��H�H�_�+�+�B�K�K�8�9��H�H�R�L��I�I�/�0���N)�__name__�
__module__�__qualname__�__firstlineno__r#�__static_attributes__r&r%r"rr&s��1r%rc��\rSrSrSrSrSrg)�
WeaveContains�>zWeave __contains__ operator.c��[SS9nURSU;5 URS/[5 UR	SU;5 g)Nc��g�Nr&r&r%r"�<lambda>�'WeaveContains.runTest.<locals>.<lambda>Bs��Dr%)�	get_scopesfoo)r	�assertFalse�	add_lines�TEXT_1�
assertTrue�rrs  r"�runTest�WeaveContains.runTestAs>���L�)������1��%�	���F�B��'�����!��$r%r&N�r'r(r)r*�__doc__r:r+r&r%r"r-r->s
��&�%r%r-c��\rSrSrSrSrg)�Easy�Hc��[5 gr1)r	)rs r"r:�Easy.runTestIs��
�r%r&N�r'r(r)r*r:r+r&r%r"r?r?Hs��r%r?c��\rSrSrSrSrg)�AnnotateOne�Mc��[5nURS/[5 URUR	S5S[S4/5 g)N�text0r)r	r6�TEXT_0�assertEqual�annotater9s  r"r:�AnnotateOne.runTestNs>���G��	���H�b�&�)�������H�-��6�!�9�0E�/F�Gr%r&NrCr&r%r"rErEMs��Hr%rEc��\rSrSrSrSrSrg)�
InvalidAdd�Tz-Try to use invalid version number during add.c�v�[5nUR[RURSS/S/5 g)NrHs69s	new text!)r	�assertRaisesr�RevisionNotPresentr6r9s  r"r:�InvalidAdd.runTestWs0���G������%�%�q�{�{�H�u�g��~�	
r%r&Nr<r&r%r"rNrNTs
��7�
r%rNc��\rSrSrSrSrSrg)�RepeatedAdd�_z%Add the same version twice; harmless.c��[5nURS/[5nURS/[5nURX#5 g)NrH)r	r6rIrJ)rr�idx�idx2s    r"�test_duplicate_add�RepeatedAdd.test_duplicate_addbs;���G���k�k�(�B��/���{�{�8�R��0������#r%r&N)r'r(r)r*r=rZr+r&r%r"rUrU_s
��/�$r%rUc��\rSrSrSrSrg)�InvalidRepeatedAdd�ic�4�[5nURS/[5 URS/[5 UR[R
URS/S/5 UR[R
URSS/[5 g)NsbasisrHsnot the same text)r	r6rIrQr�RevisionAlreadyPresentr9s  r"r:�InvalidRepeatedAdd.runTestjs~���G��	���H�b�&�)�	���H�b�&�)�����)�)�
�K�K���
!�"�	
�	
����)�)�
�K�K��
�J��	
r%r&NrCr&r%r"r]r]is��
r%r]c��\rSrSrSrSrSrg)�InsertLines�~z�Store a revision that adds one line to the original.

Look at the annotations to make sure that the first line is matched
and not stored repeatedly.
c���[5nURS/S/5 URSS/SS/5 URURS5S/5 URUR	S5SS/5 URURS5SS/5 URSS/SS	/5 URURS5SS
/5 /SQnURSSS/U5 URS
[
UR5-5 URURS5/SQ5 URS/SQ/SQ5 URURS5/SQ5 g)NrH�line 1�text1�line 2�rHrfr�rgrh�text2�
diverged line)rkrl)rf�middle linerh�text3�	k._weave=)ri�rnrmrj�text4)rHrgrn)rf�aaarm�bbbrh�ccc)ri)rqrrrp)rqrsrj)rqrt)r	r6rJrK�	get_linesrr�_weave)rr�text3s   r"r:�InsertLines.runTest�sY���G��	���H�b�9�+�.�	���H�x�j�9�i�*@�A�������H�-�0E�/F�G�������Q��)�Y�)?�@����
�J�J�x� �#8�:O�"P�	
�	
���H�x�j�9�6F�*G�H����
�J�J�x� �#8�:V�"W�	
�7��	���H�x��2�E�:�
	
����w�q�x�x�0�0�1����
�J�J�x� �V�	
�	
����*�J�	
�	
���
�J�J�x� �
�
	
r%r&Nr<r&r%r"rcrc~s���2
r%rcc��\rSrSrSrSrSrg)�DeleteLines�zYDeletion of lines from existing text.

Try various texts all based on a common ancestor.
c��[5n/SQnURS/U5 /SQ/SQSS//SQ/nSnUHnURSU-S/U5 US-
nM! URS	5 URS
[UR5-5 [[
U55H)nURURUS-5X45 M+ g)N)�one�two�three�fourrH)r}r~r)r~rr�r}r�r�text%dzfinal weave:ro)	r	r6rrrv�range�lenrJru)rr�	base_text�texts�i�ts      r"r:�DeleteLines.runTest�s����G��7�	�	���H�b�)�,�
'�'�
�W��/�	
��
���A�
�K�K�	�A�
��z�1�5�
��F�A��	
���� �����w�q�x�x�0�0�1��s�5�z�"�A����Q�[�[��Q��/���:�#r%r&Nr<r&r%r"rzrz�s���
;r%rzc��\rSrSrSrSrSrg)�
SuicideDelete��z;Invalid weave which tries to add and delete simultaneously.c�:�[5nS/Ul/SQUlg)Nr&)��{r�
first line)�[rsdeleted in 0)�]r��}r)r	rrvrQr
rur9s  r"r:�SuicideDelete.runTest�s%���G��
�
��
�
���	r%r&Nr<r&r%r"r�r��s
��E�<r%r�c��\rSrSrSrSrSrg)�CannedDelete���'Unpack canned weave with deleted lines.c��[5nS[S/5/Ul/SQUl[	S5[	S5/UlUR
URS5/SQ5 UR
URS5SS	/5 g)
Nr&r)r�r��r�r�line to be deleted�r�r�	last liner��%first lineline to be deletedlast linesfirst linelast line�r�r�r�rr�r��r	�	frozensetrrvr�_sha1srJrur9s  r"r:�CannedDelete.runTest�s����G��
��q�c�N�
��
�
���
�?�@��-�.�
���
	
���
�K�K��N�
�	
�	
���
�K�K��N���
�	
r%r&Nr<r&r%r"r�r��s
��1�$
r%r�c��\rSrSrSrSrSrg)�CannedReplacementir�c�"�[5n[5[S/5/Ul/SQUl[	S5[	S5/UlUR
URS5/SQ5 UR
URS5/SQ5 g)Nr)
r�r�r�r�r��r�r�replacement line�r�rr�r�r�s#first linereplacement linelast liner�r)r�r�r�r�r9s  r"r:�CannedReplacement.runTests����G��
�K��q�c�N�
��
�
���
�?�@��=�>�
���
	
���
�K�K��N�
�	
�	
���
�K�K��N�
�	
r%r&Nr<r&r%r"r�r�s
��1�(
r%r�c��\rSrSrSrSrSrg)�BadWeaveiJ�3Test that we trap an insert which should not occur.c�J�[5n[5/Ul/SQUlg)N)sbad liner��foo {r��  added in version 1�r�r�
  added in v2�r�r�  also from v1r�r�r��r	r�rrvrQr
�getr9s  r"r:�BadWeave.runTestMs'���G��
�K�
��
�

���"	r%r&Nr<r&r%r"r�r�Js
��=�6r%r�c��\rSrSrSrSrSrg)�	BadInsertiir�c��[5n[5[S/5[S/5[/SQ5/Ul/SQUlg)Nr�rrr)	r�r�r�r�r�s  more in 1r�r�r�r�r9s  r"r:�BadInsert.runTestlsA���G��
�K��q�c�N��q�c�N��i� �	
��
�

���	r%r&Nr<r&r%r"r�r�is
��=�6r%r�c��\rSrSrSrSrSrg)�InsertNestedi�z#Insertion with nested instructions.c��[5n[5[S/5[S/5[/SQ5/Ul/SQUl[	S5[	S5[	S5[	S5/UlUR
URS5SS	/5 UR
URS
5/SQ5 UR
URS5/S
Q5 UR
URS5/SQ5 g)Nrr�)r�r�r�r�r�r�r�r�r�r�r�sfoo {}s(foo {  added in version 1  also from v1}sfoo {  added in v2}s5foo {  added in version 1  added in v2  also from v1}r�r�r)r�r�r�r�r)r�r�r�r)r�r�r�r�r�r�r9s  r"r:�InsertNested.runTest�s����G��
�K��q�c�N��q�c�N��i� �	
��
�
���
�y�!��B�C��-�.��O�P�	
���	
������Q��(�D�)9�:����
�K�K��N�X�	
�	
������Q��)K�L����
�K�K��N�
�		
r%r&Nr<r&r%r"r�r��s
��-�/
r%r�c��\rSrSrSrSrSrg)�DeleteLines2i�z�Test recording revisions that delete lines.

This relies on the weave having a way to represent lines knocked
out by a later revision.
c�N�[5nURS//SQ5 UR[UR	S55S5 URSS/SS/5 URUR	S5SS/5 URURS5S	S
/5 g)NrH)�line the firstrhsline 3�finer�rgr�r�r)rHr�)rHr�)r	r6rJr�rurKr9s  r"r:�DeleteLines2.runTest�s����G��	���H�b�"T�U�����Q�[�[��^�,�a�0�	���H�x�j�+<�g�*F�G�������Q��*;�W�)E�F����
�J�J�x� �#@�BU�"V�	
r%r&Nr<r&r%r"r�r��s���

r%r�c��\rSrSrSrSrSrg)�IncludeVersionsi�z�Check texts that are stored across multiple revisions.

Here we manually create a weave with particular encoding and make
sure it unpacks properly.

Text 0 includes nothing; text 1 includes text 0 and adds some
lines.
c� �[5n[5[S/5/Ul/SQUl[	S5[	S5/UlUR
URS5SS/5 UR
URS5S/5 g)Nr)r�r�r�r��second liner�r��first linesecond linerr�r�r9s  r"r:�IncludeVersions.runTest�sv���G���k�9�a�S�>�2��
�
����}�-�z�:R�/S�T���������Q��-��)H�I�������Q��-��9r%r&Nr<r&r%r"r�r��s���:r%r�c��\rSrSrSrSrSrg)�DivergedIncludesi�z1Weave with two diverged texts based on version 0.c��[5n/SQUlSSSS.Ul[5[S/5[S/5/Ul/SQUl[
S5[
S5[
S5/UlURURS5S/5 URURS5SS	/5 URURS
5SS/5 UR[URS
/55SS
15 g)
N)�0�1�2rrr)	r�r�r�r�r�r�r��alternative second liner�r�r�s!first linealternative second liner�r�r�r�)r	�_names�	_name_mapr�rrvrr�rJru�set�get_ancestryr9s  r"r:�DivergedIncludes.runTest�s����G��%����a�q�1����K��q�c�N��q�c�N�
��
�


���
�}�%��/�0��;�<�
���	
������Q��-��9�������Q��-��)H�I�������T�*�]�<V�,W�X�����Q�^�^�T�F�3�4�t�T�l�Cr%r&Nr<r&r%r"r�r��s��;�#Dr%r�c��\rSrSrSrSrg)�ReplaceLineic�H�[5n/SQn/SQnURS/U5 URSS/U5 URS[UR5-5 URUR
S5U5 URUR
S5U5 g)N)�cheddarsstiltonsgruyere)r�s	blue veins
neufchatelschevrerHrgrorr)r	r6rrrvrJru)rr�text0�text1s    r"r:�ReplaceLine.runTests���G��4��D��	���H�b�%�(�	���H�x�j�%�0�����w�q�x�x�0�0�1�������Q���/�������Q���/r%r&NrCr&r%r"r�r�s��0r%r�c��\rSrSrSrSrSrg)�Mergei,z0Storage of versions that merge diverged parents.c�d�[5nS//SQ/SQ/SQ/nURS/US5 URSS/US5 URS	S/US
5 URS/SQUS
5 [U5H&up4URUR	U5U5 M( URURS5/SQ5 UR[
URS/551Sk5 URS[UR5-5 URU5 g)N�header)r�r%�line from 1)r�r%�line from 2smore from 2)r�r%r��
fixup liner�rHrrgrrkr�merge)rHrgrkr))rHr�)rgr%)rgr�)r�r�)rkr�>r�rHrgrkro)r	r6�	enumeraterJrurKr�r�rrrvr#)rrr�r�r�s     r"r:�
Merge.runTest/s���G���K�,�<�K�	
��	
���H�b�%��(�+�	���H�x�j�%��(�3�	���H�x�j�%��(�3�	���H�<�e�A�h�G��e�$�D�A����Q�[�[��^�Q�/�%�	
���
�J�J�x� �
�		
�	
��������z�*�+�-U�	
�	
����w�q�x�x�0�0�1����a� r%r&Nr<r&r%r"r�r�,s
��:�#!r%r�c��\rSrSrSrSrSrg)�	ConflictsiUz�Test detection of conflicting regions during a merge.

A base version is inserted, then two descendents try to
insert different lines in the same place.  These should be
reported as a possible conflict and forwarded to the user.
c��gr1)r	r6�mergerJr9s  r"r:�Conflicts.runTest]���r%r&Nr<r&r%r"r�r�Us
���
Ir%r�c��\rSrSrSrSrSrg)�NonConflictijzLTwo descendants insert compatible changes.

No conflict should be reported.
c��gr1)r	r6r9s  r"r:�NonConflict.runTestpr�r%r&Nr<r&r%r"r�r�js���
;r%r�c��\rSrSrSrSrSrg)�Khayyamiyz1Test changes to multi-line texts, and read/write.c	�2�/SQnUVVs/sH1o"RS5Vs/sHo3R5PM snPM3 nnn[5n[5n[	U5H8uprURSU-[
U5U5 URSU-5 M: URS[UR5-5 [	U5H&uprURURU5U5 M( URU5 gs snfs snnf)N)s�A Book of Verses underneath the Bough,
            A Jug of Wine, a Loaf of Bread, -- and Thou
            Beside me singing in the Wilderness --
            Oh, Wilderness were Paradise enow!s�A Book of Verses underneath the Bough,
            A Jug of Wine, a Loaf of Bread, -- and Thou
            Beside me singing in the Wilderness --
            Oh, Wilderness were Paradise now!s�A Book of poems underneath the tree,
            A Jug of Wine, a Loaf of Bread,
            and Thou
            Beside me singing in the Wilderness --
            Oh, Wilderness were Paradise now!

            -- O. Khayyams�A Book of Verses underneath the Bough,
            A Jug of Wine, a Loaf of Bread,
            and Thou
            Beside me singing in the Wilderness --
            Oh, Wilderness were Paradise now!�
r�ro)�split�stripr	r�r�r6�list�addrrrvrJrur#)r�rawtextsr��lr�r�parentsr�s        r"�test_multi_line_merge�Khayyam.test_multi_line_merge|s���
��,?G�G�h��W�W�U�^�4�^��'�'�)�^�4�h��G��G���%���e�$�D�A�
�K�K�	�A�
�t�G�}�a�8��K�K�	�A�
�&�%�	
����w�q�x�x�0�0�1��e�$�D�A����Q�[�[��^�Q�/�%�	
���a� ��5��Gs�D�D�D�Dr&N)r'r(r)r*r=rr+r&r%r"r�r�ys
��;�$!r%r�c�.^�\rSrSrU4SjrSrSrU=r$)�JoinWeavesTestsi�c�@>�[TU]5 [5UlS/Ul/SQUlURR
S/UR5 URR
SS/SS/5 URR
SS/UR
5 g)N�hello
)rscruel
�world
�v1�v2rsv3)�super�setUpr	�weave1�lines1�lines3r6)r�	__class__s �r"r
�JoinWeavesTests.setUp�sx���
��
���g���!�l���:��������e�R����5������e�e�W�z�:�.F�G������e�e�W�d�k�k�:r%c�:�[5nURS/S/5 URSS/SS/5 [5n[X5 UR	SUR55 [S5n[
U5nUR	SURS55 UR[URS5 UR[URS5 UR[UR5 [S5n[
U5nUR	SURS55 UR[URS5 UR[URS5 UR[UR5 g)Nrrrsthere
s�# bzr weave file v5
i
1 f572d396fae9206628714fb2ce00f72e94f2258f
n v1

i 0
1 90f265c6e75f1c8f9ab76dcf85528352c5f215ef
n v2

w
{ 0
. hello
}
{ 1
. there
}
W
s�# bzr weave file v5
i
1 f572d396fae9206628714fb2ce00f72e94f2258f
n v1

i 0
1 90f265c6e75f1c8f9ab76dcf85528352c5f215ef
n v2

w
{ 0
. hello
}
{ 1
. There
}
W
s�# bzr weave file v5
i
1 f572d396fae9206628714fb2ce00f72e94f2258f
n v1

i 0
1 f0f265c6e75f1c8f9ab76dcf85528352c5f215ef
n v2

w
{ 0
. hello
}
{ 1
. there
}
W
)r	r6rr
rJ�getvaluer�get_textrQrru�check)r�w�tmpfs   r"�test_written_detection�&JoinWeavesTests.test_written_detection�sU��
�G��	���E�2�
�|�,�	���E�E�7�Z��$<�=��y���A��	
���
8�
�M�M�O�	
��
8�
��
�t�������Q�Z�Z��%6�7����.��
�
�E�B����.����U�C����.����8��
8�
��
�t�������Q�Z�Z��%6�7����.��
�
�E�B����.����U�C����.����8r%)rr
r)r'r(r)r*r
rr+�
__classcell__)rs@r"rr�s���;�49�49r%rc� �\rSrSrSrSrSrg)�	TestWeavei�c��[SSS9nURS/[5 UR[R
URS5 g)N�nameF��allow_reserved�name:)r	r6r7rQr�
ReservedIdru�rrs  r"�test_allow_reserved_false�#TestWeave.test_allow_reserved_false�s:���&��/��	���H�b�&�)����&�+�+�Q�[�[�(�Cr%c��[SSS9nURS/[5 UR[UR	S55 g)NrTrr)r	r6r7rJrur!s  r"�test_allow_reserved_true�"TestWeave.test_allow_reserved_true�s7���&��.��	���H�b�&�)��������X�!6�7r%r&N)r'r(r)r*r"r%r+r&r%r"rr�s
��D�8r%rc�(�\rSrSrSrSSjrSrSrg)�InstrumentedWeavei�z2Keep track of how many times functions are called.Nc�:�SUl[R"XS9 g)Nr)�
weave_name)�_extract_countr	�__init__)rr*s  r"r,�InstrumentedWeave.__init__�s�����
���t�3r%c�X�U=RS-
sl[R"X5$)Nr)r+r	�_extract)r�versionss  r"r/�InstrumentedWeave._extract�s"�����q� ���~�~�d�-�-r%)r+r1)r'r(r)r*r=r,r/r+r&r%r"r(r(�s��<�4�.r%r(c��\rSrSrSrSrSrg)�TestNeedsReweavei�z1Internal corner cases for when reweave is needed.c��[S5n1SknURURUS155 URURU[U555 URUR[5[555 UR	UR[5S155 UR	URU1Sk55 UR	URUS155 g)N�a>rrrrr>rrrr�r�)r	r8�_compatible_parentsr�r5)r�w1�
my_parentss   r"�test_compatible_parents�(TestNeedsReweave.test_compatible_parentss���
�3�Z���
�����.�.�z�A�3�?�@�����.�.�z�3�z�?�K�L�����.�.�s�u�c�e�<�=�����/�/����s�;�<�����/�/�
�L�I�J�����/�/�
�Q�C�@�Ar%r&N)r'r(r)r*r=r9r+r&r%r"r3r3�s��;�Br%r3c��\rSrSrSrSrg)�
TestWeaveFileic��[SS5nUR[[U5 SSS5 g!,(df   g=f)Nzempty.weavezwb+)�openrQr
r)r�fs  r"�test_empty_file�TestWeaveFile.test_empty_files-��
�-��
'�1����.�
�A�>�(�
'�
'�s	�2�
Ar&N)r'r(r)r*r@r+r&r%r"r<r<s��?r%r<N)0r=�ior�pprintrrr�osutilsr�weaver	r
r�	weavefilerr
rrrIr7rr-r?rErNrUr]rcrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr(r3r<r&r%r"�<module>rGs���,&����!�A�A�/�)��	��
�*�	+��1�x�1�0%�H�%��8��
H�(�H�
��
�$�(�$�
��
�*9
�(�9
�x;�(�;�@<�H�<�0'
�8�'
�T+
��+
�\6�x�6�>6��6�@2
�8�2
�j
�8�
�.:�h�:�<&D�x�&D�R
0�(�
0� &!�H�&!�RI��I�*;�(�;�'!�h�'!�T>9�h�>9�B8��8�	.��	.�B�x�B�$?�%�?r%

Youez - 2016 - github.com/yon3zu
LinuXploit