403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/mercurial/testing/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/testing/__pycache__/storage.cpython-39.pyc
a

�+�b���@s�ddlmZddlZddlmZmZddlmZddlm	Z	m
Z
ddlmZddl
mZGd	d
�d
ej�ZGdd�de�ZGd
d�de�ZGdd�de�Zdd�Zdd�Zdd�ZdS)�)�absolute_importN�)�hex�nullrev)�getattr)�error�mdiff)�
repository)�storageutilc@s"eZdZeejdd�sejjZdS)�basetestcase�assertRaisesRegexFN)�__name__�
__module__�__qualname__r�unittest�TestCaseZassertRaisesRegexpr�rr�?/usr/lib64/python3.9/site-packages/mercurial/testing/storage.pyrs�rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�ifileindextestsz�Generic tests for the ifileindex interface.

    All file storage backends for index data should conform to the tests in this
    class.

    Use ``makeifileindextests()`` to create an instance of this type.
    c	Cs�|��}|�t|�dd�|�t|�gd�t|�}|�t��t|�Wd�n1s\0Y|�|�	d��|�|�	d��|�|�	t
��|�|�	|j��|�|�	d��|�|�	d��|�t|���g�t|���}|�t��t|�Wd�n1�s0Y|�t|jdd��g�|�|�
|j�|j|jf�|�|�t
�t
t
f�|�tj��|�
d�Wd�n1�s�0Ytd	d
�D]J}|t
k�r��q�|�t��|�|�Wd�n1�s�0Y�q�|�|�|j�t
�|�|�t
�|j�|�tj��|�d�Wd�n1�sJ0Ytd	d
�D]J}|t
k�rp�q^|�t��|�|�Wd�n1�s�0Y�q^|�|�|j�|j�|�|�t
�|j�|�|�t|j��|j�|�|�dt
�|j�|�tj��|�d�Wd�n1�s40Y|�tj��(|�t|j�dd
��Wd�n1�sz0Y|�tj��|�d�Wd�n1�s�0Y|�tj��|�d�Wd�n1�s�0Y|�tj��|�d�Wd�n1�s"0Y|�tj��|�d�Wd�n1�sZ0Ytd	d
�D]J}|t
k�r��qn|�t��|�|�Wd�n1�s�0Y�qn|�|�t
�t
�td	d
�D]J}|t
k�r�q�|�t��|�|�Wd�n1�s0Y�q�|�|�t
��td	d
�D]J}|t
k�rN�q<|�t��|�|�Wd�n1�sz0Y�q<|�t|�|j|j��g�|�t��&|�t|�g��g�Wd�n1�s�0Y|�t|�t
g��g�|�|��|jg�|�|�|j�|jg�|�|�d|jg�|jg�|�|�|j|jg�|jg�|�|�|j�g�|�tj��|�d�Wd�n1�s�0YdS)Nrs&new file store has 0 length by defaultsiter yields nothing by default�0saaaaaaaaaaaaaaaaaaaa���start������%dsbadvalue��-2�1s&11111111111111111111111111111111111111)�_makefilefn�assertEqual�len�list�iter�assertRaises�
StopIteration�next�assertFalse�hasnoder�nullid�revs�parents�
parentrevsr�LookupError�range�
IndexError�rev�node�lookupr�linkrev�
iscensored�commonancestorsheads�
ValueError�descendants�heads�children)�self�f�genr+�irrr�	testempty)s�&(*
.*
.*8****
.
.
.6zifileindextests.testemptyc	Cs�|��}|���(}|�dd|d|j|j�}Wd�n1s>0Y|�t|�d�|�t|�dg�t|�}|�t|�d�|�	t
��t|�Wd�n1s�0Y|�|�|��|�
|�t|���|�
|�t��|�
|�|j��|�
|�|dd���|�
|�t|�dd���|�t|���dg�|�t|jdd��g�|�t|jdd��dg�|�t|jdd��dg�|�t|jdd��dg�|�t|�dd��g�|�t|�dd��ddg�|�t|�dd��gd	��|�|�|�|j|jf�|�|�d�ttf�|�	tj��|�d
�Wd�n1�sX0Y|�	t��|�d�Wd�n1�s�0Y|�|�|�d�|�	tj��|�d
�Wd�n1�s�0Y|�|�d�|�|�	t��|�d�Wd�n1�s 0Y|�|�|�|�|�|�d�|�|�|�d�|j�|�|�d�|�|�|�t|��|�|�	tj��&|�t|�dd��Wd�n1�s�0Y|�	tj��|�d
�Wd�n1�s�0Y|�	tj��|�d�Wd�n1�s40Y|�	tj��|�d�Wd�n1�sl0Y|�	tj��|�d�Wd�n1�s�0Y|�|�d�d�|�	t��|�d�Wd�n1�s�0Y|�
|�d��|�	t��|�d�Wd�n1�s20Y|�t|�dg��g�|�|��|g�|�|�|�|g�|�|j|gd�|g�|�	tj��|jd
gd�Wd�n1�s�0Y|�|�|�g�dS)N�initialr�rrr��stopr�rrArr���r���rr)r �_maketransactionfn�addr*r!r"r#r$r'r%r&�
assertTruer)r(rrr+r,r-rr.r0r1r2r3r4r5r8r9r:)r;r<�trr2r=rrr�testsinglerevision�s~
6&****6******.z"ifileindextests.testsinglerevisionc
	Cs�d}|d}d|d}|��}|���T}|�|d|d|j|j�}|�|d|d||j�}|�|d|d||j�}Wd�n1s�0Y|�t|�d�|�t|�gd��t|�}	|�t|	�d�|�t|	�d�|�t|	�d�|�	t
��t|	�Wd�n1�s0Y|�t|���gd��|�t|�d��gd��|�t|�d��ddg�|�t|�d��dg�|�t|�d��g�|�t|jdd	��ddg�|�t|jdd	��gd��|�t|jdd	��gd��|�t|�dd��gd
��|�t|�dd��ddg�|�t|�dd��ddg�|�|�|�|j|jf�|�|�|�||jf�|�|�|�||jf�|�|�
d�ttf�|�|�
d�dtf�|�|�
d�dtf�|�|�|�d�|�|�|�d�|�|�|�d�|�	tj��|�d�Wd�n1�s.0Y|�|�d�|�|�|�d�|�|�|�d�|�|�	t��|�d�Wd�n1�s�0Y|�|�|�|�|�|�d�|�|�|�d�|�|�|�t|��|�|�|�|�|�|�|�d�|�|�|�d
�|�|�|�t|��|�|�|�d�d�|�|�d�d�|�|�d�d�|�	t��|�d�Wd�n1�s�0Y|�|�d��|�|�d��|�|�d��|�	t��|�d�Wd�n1�s0Y|�|�||j�g�|�|�||�|g�|�|�||�|g�|�|�||�|g�|�|�||�|g�|�|�||�|g�|�t|�dg��ddg�|�t|�dg��dg�|�t|�ddg��ddg�|�|��|g�|�|�|�|g�|�|�|�|g�|�|�|�|g�|�|j|gd	�||g�|�|j|gd	�||g�|�|j||gd	�||g�|�	tj��|jdgd	�Wd�n1�s�0Y|�|�|�|g�|�|�|�|g�|�|�|�g�dS)N�xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx�y�zrrA��rrArrrBrDrrr)r rGrHr*r!r"r#r$r'r%r&r+r,r-rr1rr.r2r0r3rr4r(r5r6r8r9r:)
r;�	fulltext0�	fulltext1�	fulltext2r<rJ�node0�node1�node2r=rrr�testmultiplerevisions�s�
4(****.z%ifileindextests.testmultiplerevisionsc		Cs�|��}|����}|�dd|d|j|j�}|�dd|d||j�}|�dd|d||j�}|�dd|d||j�}|�d	d|d
||j�}|�dd|d||j�}Wd�n1s�0Y|�t|�d
�|�t|�dg��gd��|�t|�dg��dg�|�t|�dg��g�|�t|�dg��d
g�|�t|�ddg��gd��|�t|�ddg��dd
g�|�|��|||g�|�|�|�|||g�|�|�|�|g�|�|�|�|g�|�|�|�|g�|�|�|�|g�|�|�|�|g�|�|j|gd�||||g�|�|j|gd�||||g�|�|�	|�|||g�|�|�	|�|g�|�|�	|�g�|�|�	|�|g�|�|�	|�g�|�|�	|�g�dS)NrrrrA�2r�3rO�4��5r�)rArrOr[rrB)
r rGrHr*r!r"r#r8r9r:)	r;r<rJrTrUrVZnode3Znode4Znode5rrr�testmultipleheadsjs<
4z!ifileindextests.testmultipleheadsN)r
rr�__doc__r?rKrWr^rrrrr s
v\orc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�ifiledatatestsz�Generic tests for the ifiledata interface.

    All file storage backends for data should conform to the tests in this
    class.

    Use ``makeifiledatatests()`` to create an instance of this type.
    c	Cs�|��}|�|��i�|�|jddd�ddd��|�|�t�d�tdd�D]B}|tkr^qP|�t��|�|�Wd�qP1s�0YqP|�|�|j	�d�|�|�
|j	�d�|�tj��|�d�Wd�n1s�0Y|�|�
|j	�d�|�tj��|�
d�Wd�n1�s40Y|�|�|j	��|�tj��|�
d�Wd�n1�s~0Y|�|�|j	d��|�|�|j	d	��|�tj��|�dd
�Wd�n1�s�0Y|�g�}|�t��t|�Wd�n1�s0Y|�|j	g�}|�t��t|�Wd�n1�s`0Y|�tj�� t|�dg��Wd�n1�s�0YdS)NT�ZrevisionscountZtrackedsizer�srevisionscountstrackedsizerr�r�foo�
irrelevant)r r!�storageinfo�sizerr/r%r0�revisionr*�rawdatarr.�readr(�renamedrI�cmp�
emitrevisionsr&r'r#)r;r<r>r=rrrr?�sD�*(**,
((zifiledatatests.testemptyc	Cs�d}|��}|���(}|�|d|d|j|j�}Wd�n1sB0Y|�|��i�|�|jddd�dt|�d��|�|�d�t|��|�t	��|�d�Wd�n1s�0Y|�|�
|�|�|�|�|�|�|�|�|�|�|�
|�|��|�
|�||��|�|�||d��|�|g�}t|�}|�|j|�|�|j|j�|�|j|j�|�|j�|�|j|j�|�|j�|�|j
�|�|j�|�t��t|�Wd�n1�s�0Y|j|gdd�}t|�}|�|j|�|�|j|j�|�|j|j�|�|j�|�|j|j�|�|j�|�|j
|�|�|j�|�t��t|�Wd�n1�s�0Y|�tj��"t|�|d	g��Wd�n1�s�0YdS)
Nr@rTrarArbsextra��revisiondatar)r rGrHr*r!rfr"rgr%r0rhrirjr(rkrlrIrmr'r2�p1node�p2node�assertIsNone�linknode�basenode�baserevisionsize�deltar&rr.r#)r;�fulltextr<rJr2r=r1rrrrK�sX
6�(((z!ifiledatatests.testsinglerevisionc	Csrd}|d}d|d}|��}|���T}|�|d|d|j|j�}|�|d|d||j�}|�|d|d||j�}Wd�n1s�0Y|�|��i�|�|jddd�dt|�t|�t|�d	��|�|�d�t|��|�|�d�t|��|�|�d
�t|��|�t	��|�d�Wd�n1�s:0Y|�|�
|�|�|�|�|�|�|�|�
|�|�|�|�|�|�|�|�
|�|�|�|�|�|�|�tj
��|�
d�Wd�n1�s�0Y|�|�|�|�|�|�|�|�|�|�|�|�|�tj
��|�d�Wd�n1�sL0Y|�|�|��|�|�|��|�|�|��|�tj
��|�d�Wd�n1�s�0Y|�|�||��|�|�||��|�|�||��|�|�||��|�|�||��|�tj
��|�dd�Wd�n1�sH0Y|j|||gdd
�}	t|	�}
|�|
j|�|�|
j|j�|�|
j|j�|�|
j�|�|
j|j�|�|
j�|�|
j
|�|�|
j�t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j�|�|
j|�|�|
j�|�|
j
�|�|
jd|�t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j�|�|
j|�|�|
j�|�|
j
�|�|
jd|�|�t��t|	�Wd�n1�s�0Y|j|||gdd
�}	t|	�}
|�|
j|�|�|
j|j�|�|
j|j�|�|
j�|�|
j|j�|�|
j�|�|
j
|�|�|
j�t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j�|�|
j|�|�|
j�|�|
j
�|�|
jd|�t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j�|�|
j|�|�|
j�|�|
j
�|�|
jd|�|�t��t|	�Wd�n1�s�0Y|�tj��"t|jgdd��Wd�n1�s�0Yt|j|||gdd��}|�t|�d�|�dd�|D�|||h�|j||gddd�}	t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j|j�|�|
j�|�|
j
|�|�|
j�t|	�}
|�|
j|�|�|
j|j�|�|
j|j�|�t��t|	�Wd�n1�s0Y|j||hdd
�}	t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j|j�|�|
j�|�|
j
|�|�|
j�t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j|�|�|
j�|�|
j
�|�|
jd|�|�t��t|	�Wd�n1�	s00Y|j||gddd�}	t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j|�|�|
j�|�|
j
�|�|
jd|�|j|gdt j!d�}	t|	�}
|�|
j|�|�|
j|j�|�|
j|j�|�|
j|j�|�|
j�|�|
j
�|�|
jd|�|�t��t|	�Wd�n1�
sh0Y|j||gdt j!d�}	t|	�}
|�|
j|�|�|
j|j�|�|
j|j�|�|
j|j�|�|
j�|�|
j
�|�|
jd|�t|	�}
|�|
j|�|�|
j|�|�|
j|j�|�|
j|�|�t��t|	�Wd�n1�sd0YdS)NrLrMrNrrArOTrarbrrrernsssbad)�
nodesordersstoragecSsh|]
}|j�qSr�r2)�.0�orrr�	<setcomp>�rcz7ifiledatatests.testmultiplerevisions.<locals>.<setcomp>snodes)rxro)roZassumehaveparentrevisions)roZ	deltamodes)"r rGrHr*r!rfr"rgr%r0rhrirr.rjr(rkrlrIrmr'r2rprqrrrsrtrurvr&ZProgrammingErrorr#r	ZCG_DELTAMODE_PREV)r;rQrRrSr<rJrTrUrVr=r1�resrrrrWs�
4����
****,��(��(2�
�(�(
��
��(��z$ifiledatatests.testmultiplerevisionsc
	Cs�d}d}d}ddd�}ddd�}d	�d
d|g�}d	�dd
|g�}|��}|���V}	|�|d|	d|j|j�}
|�|||	d|
|j�}|�|||	d|j|j�}Wd�n1s�0Y|�|�d�t|��|�|�d�t|��|�|�|�|�|�|�	|�|�|�|�|�|�|�|�	|�|�|�|�
|�|�|�|�
|�|�|�|�|��|�|�|�d�|�
|�||��|�
|�||��|�|�||��|�
|�||��dS)Nrd�barsbaz�source0s(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa�scopyscopyrev�source1�(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbrc�
copy: source0
s4copyrev: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

s
copy: source1
s4copyrev: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

rrAr)r����������������������)�joinr rGrHr*r!rgr"rhrirjr(rkrIrl)
r;rQrRrS�meta1Zmeta2�stored1Zstored2r<rJrTrUrVrrr�testrenamed*sP������
6zifiledatatests.testrenamedc
	Csrd}d}d}ddd�}d�dd	dd
g�}|��}|���@}|�|i|d|j|j�}|�|||d|j|j�}	Wd�n1s�0Y|�|�d�t|�d
�|�|�d�t|��|�|�|�|�|�|�	|�|�|�|�|	�|�|�|�	|	�|�|�|�
|�|�|�|�
|	�|�|�|�||��|�
|�||��|�|�|	|��|�
|�|	|��dS)Ns
foos	


foos
barrr�r�rcr�scopyrev: %s
s

barrrAr[)r�r rGrHr*r!rgr"rhrirjr(rlrI)
r;rQZstored0rRr�r�r<rJrTrUrrr�testmetadataprefixds8���
6z!ifiledatatests.testmetadataprefixc
CsB|��}d}|d}|���F}|�|d|d|j|j�}d}|j|||||jd|d�Wd�n1sh0Y|�t|�d�|�|�|�||jf�|�t	j
��|�|�Wd�n1s�0Y|�t	j
��|�|�Wd�n1s�0Y|�t	j
��|�
|�Wd�n1�s40YdS)N�xfoo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
�bar
r���������������������rA�Zrawtextr)r rGrHr*�_addrawrevisionfnr!r"r,r%r�StorageErrorrhrirj�r;r<rQrRrJrTrUrrr�testbadnoderead�s"
�$((zifiledatatests.testbadnodereadc
Cs�|��}d}|d}|���F}|�|d|d|j|j�}d}|j|||||jd|d�Wd�n1sh0Y|�tj��|�|�Wd�n1s�0Y|�tj��|�|�Wd�n1s�0YdS�Nr�r�rr�rAr�)	r rGrHr*r�r%rr�rir�rrr�testbadnoderevisionraw�s
�$(z%ifiledatatests.testbadnoderevisionrawc
Cs�|��}d}|d}|���F}|�|d|d|j|j�}d}|j|||||jd|d�Wd�n1sh0Y|�tj��|�|�Wd�n1s�0Y|�tj��|�|�Wd�n1s�0YdSr�)	r rGrHr*r�r%rr�rjr�rrr�testbadnoderevision�s
�$(z"ifiledatatests.testbadnoderevisionc

Cs:|��}d}|d}|d}|���F}|�|d|d|j|j�}d}|j|||||jd|d�Wd�n1sp0Y|�tj��|�|�Wd�n1s�0Yt	�
|||j�}|���:}t�||�}	|j|||||jdd|	fd	�Wd�n1�s
0Y|�
t|�d
�|�
|�|�|�dS)N�|foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
r�sbaz
rr�rAr�r)rvrO)r rGrHr*r�r%rr�rjr
Zhashrevisionsha1r�textdiffr!r")
r;r<rQrRrSrJrTrUrVrvrrr�testbadnodedelta�s(
�$(
�&zifiledatatests.testbadnodedeltacCs0|��}t�ddid�}|���H}|�dd|d|j|j�}d}|j|||||jd|dd	�Wd�n1sn0Y|�|�d��|�	t
j��|�d�Wd�n1s�0Y|�	t
j��|�
d�Wd�n1s�0Y|�	t
j��|�d�Wd�n1�s"0YdS�
N�censored�	tombstonercrdrr�rAT�Zcensored)r r
�packmetarGrHr*r�rIr5r%r�CensoredNodeErrorrhrirj�r;r<r�rJrTrUrrr�testcensored�s&��
�$((zifiledatatests.testcensoredcCs�|��}t�ddid�}|���H}|�dd|d|j|j�}d}|j|||||jd|dd	�Wd�n1sn0Y|�tj	��|�
d�Wd�n1s�0YdSr�)r r
r�rGrHr*r�r%rr�rir�rrr�testcensoredrawrevisions��
�$z&ifiledatatests.testcensoredrawrevisionN)r
rrr_r?rKrWr�r�r�r�r�r�r�r�rrrrr`�s6@:+! r`c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)�ifilemutationtestsz�Generic tests for the ifilemutation interface.

    All file storage backends that support writing should conform to this
    interface.

    Use ``makeifilemutationtests()`` to create an instance of this type.
    c	Cs�|��}|���X}|�dd|d|j|j�}|�dd|d|j|j�}|�dd|d|j|j�}Wd�n1sn0Y|�||�|�||�|�t|�d�dS)NrdrrA)r rGrHr*r!r"�r;r<rJrTrUrVrrr�testaddnoop?s
6zifilemutationtests.testaddnoopc
Csz|��}|���V}|�tj��*|jd|d|j|jdd�Wd�n1sN0YWd�n1sl0YdS)Nrdrrry)r rGr%rr��addrevisionr*�r;r<rJrrr�testaddrevisionbadnodeKs
�z)ifilemutationtests.testaddrevisionbadnodec
Cs�|��}|����}tddd�D] }d|>tj@rd|>}q@q|�tj��*|jd|d|j	|j	|d�Wd�n1s|0YWd�n1s�0YdS)N�rrErArd)�flags)
r rGr/r	ZREVISION_FLAGS_KNOWNr%rr�r�r*)r;r<rJr>r�rrr�testaddrevisionunknownflagTs
z-ifilemutationtests.testaddrevisionunknownflagc
	s�|��}g��fdd��dd�}|���B}g���fdd�}�fdd�}|jgd|||d	�Wd�n1sp0Y|��g�|��g�|�t|�d
�d}t�t|��|}|���(}|�|d|d
|j|j�}Wd�n1s�0Y|��}||j|j|j|j|d
ifg}	|���B}g���fdd�}�fd
d�}|j|	||||d	�Wd�n1�sp0Y|��dg�|�t��d�|��d
d
d�d
�|�t	|�
��d
g�|�|��d
�d
�|�|�d
��d
�dS)Ncs��||f�dS�N)�append)�args�kwargs)�callbackargsrr�cbdsz1ifilemutationtests.testaddgroupsimple.<locals>.cbcSsdS�Nrrryrrr�
linkmappergsz9ifilemutationtests.testaddgroupsimple.<locals>.linkmappercs"|�|�}��|��||�dSr��r2r���clr1r2�r��nodesrr�onchangesetms

z:ifilemutationtests.testaddgroupsimple.<locals>.onchangesetcs��|�|��dSr��r�r2�r�r1�r�rr�ondupchangesetrsz=ifilemutationtests.testaddgroupsimple.<locals>.ondupchangeset�Z
addrevisioncbZduplicaterevisioncbrrdcs"|�|�}��|��||�dSr�r�r�r�rrr��s

cs��|�|��dSr�r�r�r�rrr��ssI�˱\�W�GkF��z���yrA)
r rG�addgroupr!r"r�trivialdiffheaderrHr*r#r+r1r2)
r;r<r�rJr�r�rQZdelta0rT�deltasr)r�r�r�r�testaddgroupsimple_s\
�$
6�
�&��z%ifilemutationtests.testaddgroupsimplec
s�|��}gd�}g}|���8}|D]"}|�|�|d|d|j|j��q"Wd�n1sZ0Y|��}g}t|�D]@\}}t�t|��|}|�|||j|j|j|j|dif�qx|���D}g��fdd�}	|j	|dd�||	|	d�|�
�|�Wd�n1�s0Y|�
t|�t|��|�
t|���gd��|�
|�
|d�d�|�
|�
|d	�d	�|�
|�
|d
�d
�|�
|�d�|d�|�
|�d	�|d	�|�
|�d
�|d
�dS)N)rdr~rLrcs��|�|��dSr�r�r��Znewnodesrrr��sz<ifilemutationtests.testaddgroupmultiple.<locals>.onchangesetcSsdSr�r��xrrr�<lambda>�rcz9ifilemutationtests.testaddgroupmultiple.<locals>.<lambda>r�rPrAr)r rGr�rHr*�	enumeraterr�r"r�r!r#r+r1r2)
r;r<Z	fulltextsr�rJrwr�r>rvr�rr�r�testaddgroupmultiple�s@
>�
�,z'ifilemutationtests.testaddgroupmultiplecCs|��}t�ddid�}|���H}|�dd|d|j|j�}d}|j|||||jd|dd	�Wd�n1sn0Yt�d
d�}d||jd
||difg}|���N}|�	t
j��"|�|dd�|�Wd�n1s�0YWd�n1s�0YdS)Nr�r�rcr�rr�rATr�sxbar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
s|bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
bar
baz
s��������������������rcSsdSr�rr�rrrr��rcz=ifilemutationtests.testdeltaagainstcensored.<locals>.<lambda>)
r r
r�rGrHr*r�rr�r%rZCensoredBaseErrorr�)r;r<r�rJrTrUrvr�rrr�testdeltaagainstcensored�s$��
�$�
z+ifilemutationtests.testdeltaagainstcensoredc	Cs0|��}|���T}|�dd|d|j|j�}|�dd|d||j�}|�dd|d||j�}Wd�n1sj0Y|���}|�||�Wd�n1s�0Y|�t|�d�|�t|���gd��|�|�	|�d�|�|�	|�d�|�
tj��|�	|�Wd�n1�s"0YdS)	Nr�rr�rAs�foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
rrOrP)
r rGrHr*Zcensorrevisionr!r"r#r+rjr%rr�r�rrr�testcensorrevisionbasic�s
4
*z*ifilemutationtests.testcensorrevisionbasicc
Cs�|��}|���:}td�D] }|�d|d|||j|j�qWd�n1sP0Ytd�D]}|�|�|�|t�f�qbdS�N�
r)r rGr/rHr*r!�
getstrippoint�set)r;r<rJr1rrr�testgetstrippointnoparentss
<z-ifilemutationtests.testgetstrippointnoparentsc
Cs�|��}|���>}|j}td�D]}|�d|d||||j�q Wd�n1sT0Ytd�D]}|�|�|�|t�f�qfdSr�)r rGr*r/rHr!r�r��r;r<rJZp1r1rrr�testgetstrippointlinears
:z*ifilemutationtests.testgetstrippointlinearc	Cs�|��}|����}|�dd|d|j|j�}|�dd|d||j�}|�dd|d||j�|�dd|d||j�|�d	d|d
||j�Wd�n1s�0Ytd�D]}|�|�|�|t�f�q�dS)NrrrrArXrrYrOrZr[r)r rGrHr*r/r!r�r�)r;r<rJrTrUr1rrr�testgetstrippointmultipleheads(s
4z1ifilemutationtests.testgetstrippointmultipleheadsc	Cs�|��}|���T}|�dd|d|j|j�}|�dd|d||j�|�dd|d||j�Wd�n1sj0Y|�|�d�dt�f�|�|�d�dt�f�|�|�d�dt�f�|�|�d	�dt�f�|�|�d
�dt�f�|�|�d�dt�f�|�|�d�ddhf�|�|�d�ddhf�|�|�d
�ddhf�|�|�d�ddhf�|�|�d�ddhf�|�|�d�d	t�f�dS)Nrrrr�rXrrArrOr[r]���	�)r rGrHr*r!r�r�)r;r<rJrTrrr� testgetstrippointearlierlinkrevs5s"
4z3ifilemutationtests.testgetstrippointearlierlinkrevscCsP|��}|���}|�d|�Wd�n1s20Y|�t|�d�dSr�)r rG�stripr!r"r�rrr�teststripemptyJs
*z!ifilemutationtests.teststripemptyc
Cs�|��}|���>}|j}td�D]}|�d|d||||j�}q Wd�n1sT0Y|�t|�d�|���}|�d|�Wd�n1s�0Y|�t|�d�dS)Nr�rr)r rGr*r/rHr!r"r�r�rrr�teststripallRs
:
*zifilemutationtests.teststripallc	Cs|��}|���X}|�dd|d|j|j�|�dd|d|j|j�}|�dd|d|j|j�}Wd�n1sn0Y|�t|�d�|���}|�d|�Wd�n1s�0Y|�t|�d�|���}|�d|�Wd�n1s�0Y|�t|�d	�|�tj	��|�
|�Wd�n1�s>0Y|���}|�d
|�Wd�n1�st0Y|�t|�d	�|���}|�d|�Wd�n1�s�0Y|�t|�d�|�tj	��|�
|�Wd�n1�s0YdS)NrrrrrXr�rOr�rr]rA)r rGrHr*r!r"r�r%rr.r1)r;r<rJrUrVrrr�teststrippartialas,
6
*
**
,
,z#ifilemutationtests.teststrippartialN)r
rrr_r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�6s	P/

r�cCs|||d�}tdtf|�S)a9Create a unittest.TestCase class suitable for testing file storage.

    ``makefilefn`` is a callable which receives the test case as an
    argument and returns an object implementing the ``ifilestorage`` interface.

    ``maketransactionfn`` is a callable which receives the test case as an
    argument and returns a transaction object.

    ``addrawrevisionfn`` is a callable which receives arguments describing a
    low-level revision to add. This callable allows the insertion of
    potentially bad data into the store in order to facilitate testing.

    Returns a type that is a ``unittest.TestCase`` that can be used for
    testing the object implementing the file storage interface. Simply
    assign the returned value to a module-level attribute and a test loader
    should find and run it automatically.
    �r rGr�r)�typer�Z
makefilefnZmaketransactionfnZaddrawrevisionfn�drrr�makeifileindextests�s
�r�cCs|||d�}tdtf|�S)Nr�r`)r�r`r�rrr�makeifiledatatests�s
�r�cCs|||d�}tdtf|�S)Nr�r�)r�r�r�rrr�makeifilemutationtests�s
�r�)Z
__future__rrr2rrZpycompatr�rrZ
interfacesr	Zutilsr
rrrr`r�r�r�r�rrrr�<module>s,t)R	

Youez - 2016 - github.com/yon3zu
LinuXploit