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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

p��g-��f�SrSSKrSSKJr SSKJr SSKJr SSKJrJ	r	J
r
JrJr "SS	\5r
g)
z�Tests for rio serialization.

A simple, reproducible structured IO format.

rio itself works in Unicode strings.  It is typically encoded to UTF-8,
but this depends on the transport.
�N)�
TemporaryFile)�TestCase�)�rio)�	RioReader�Stanza�read_stanza�read_stanzas�rio_filec���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSr\S5rSrSrSrSrSrSrSrS!SjrSr Sr!Sr"g )"�TestRio�"c�j�[SSS9nURSU;5 URSU;5 URSU;5 UR[	UR55SS/5 URUR
S5S5 URUR
S5S5 g	)
zConstruct rio stanza in memory.�42�fred��number�namer�color)rr)rrrN)r�
assertTrue�assertFalse�assertEqual�list�
iter_pairs�get��self�ss  �;/usr/lib/python3/dist-packages/breezy/bzr/tests/test_rio.py�test_stanza�TestRio.test_stanza#s����$�V�,������A�
�&�����A��&�������#�����a�l�l�n�-�0@�BR�/S�T�������x��$�/�������v���/�c�V�[SS9nURUR5S5 g)z"Serialize stanza with empty field.�)�emptysempty: 
N)rr�	to_stringrs  r�test_empty_value�TestRio.test_empty_value-s"��������������5r"c�n�[SSS9nUR[UR55SS/5 g)z"Write simple rio stanza to string.rrrsname: fred
snumber: 42
N)rrr�to_linesrs  r�
test_to_lines�TestRio.test_to_lines2s.���$�V�,������a�j�j�l�+�o��-O�Pr"c�b�[SSS9nUR5nURUSSS.5 g)z!Convert rio Stanza to dictionary.rrrN)r�as_dictr)rr�sds   r�test_as_dict�TestRio.test_as_dict7s.���$�V�,��
�Y�Y�[�������f�=�>r"c��[5n[SSSS9nURU5 URS5 UR	UR5S5 g)zWrite rio to file.z%something with "quotes like \"this\""rr)�a_thingrrrsEa_thing: something with "quotes like \"this\""
name: fred
number: 42
N)rr�write�seekr�read�r�tmpfrs   r�test_to_file�TestRio.test_to_file=sO������=�d�QW�
��	
����
��	�	�!������I�I�K�
�	
r"c��[5n[SS9nURU5 URS5 UR	UR5S5 URS5 [
U5nUR	X#5 g)Nz5war is peace
freedom is slavery
ignorance is strength)�mottors?motto: war is peace
	freedom is slavery
	ignorance is strength
)rrr4r5rr6r	)rr8r�s2s    r�test_multiline_string�TestRio.test_multiline_stringNsk������R�S��	����
��	�	�!������I�I�K�
�	
�	
�	�	�!��
��
������r"c�2�SRS5n[U5nURSU;5 URUR	S5S5 UR[UR
55/SQ5 UR[U5S5 g)zLoad stanza from string.s|revision: mbp@sourcefrog.net-123-abc
timestamp: 1130653962
timezone: 36000
committer: Martin Pool <mbp@test.sourcefrog.net>
T�revision�mbp@sourcefrog.net-123-abc))rArB)�	timestamp�
1130653962)�timezone�36000)�	committerz%Martin Pool <mbp@test.sourcefrog.net>�N)�
splitlinesr	rrrrr�len)r�linesrs   r�test_read_stanza�TestRio.test_read_stanza_s����
�J�t��	�
�������
�a��(�������z�*�,H�I��������� �
�	
�	
����Q���#r"c�0�[5nSHup#URX#5 M [UR55nUR	X5 UR	URS5/SQ5 UR	URS5/SQ5 g)zRepeated field in rio.))�a�10)�b�20)rO�100)rQ�200)rO�1000)rQ�2000rO)rPrSrUrQ)rRrTrVN)r�addr	r*r�get_all)rr�k�vr=s     r�test_repeated_field�TestRio.test_repeated_fieldusv���H��
�D�A�
�E�E�!�K�
������
&�������������3��)>�?�������3��)>�?r"c��[SS9nUR5nURUS5 [UR	55nURX5 g)N�\)�qsq: \
)rr&rr	r*)rr�tr=s    r�test_backslash�TestRio.test_backslash�sD���T�N��
�K�K�M������J�'�
�����
&������r"c��[SSSS9nURUR5S5 [UR	55nURX5 g)Nr$�
z

)�none�one�twosnone: 
one: 
	
two: 
	
	
)rrr&r	r*�rrr=s   r�test_blank_line�TestRio.test_blank_line�sL�����&�1�����
�K�K�M�
�
	
������
&������r"c���[SSSS9nURUR5S5 [UR	55nURX5 URU/5 g)N� z			z
		
)�space�tabs�combos!combo: 
			
	
space:  
tabs: 			
)rrr&r	r*�rio_file_stanzasrhs   r�test_whitespace_value�TestRio.test_whitespace_value�s\����8�:�>�����
�K�K�M�
�		
������
&����������q�c�"r"c�z�[SSSSSSSSS	S
9	n[UR55nURX5 g)zRio quoted string cases.z"hello"z "forz

"for"
z	for
"
forrd�"�""r^z\"\")	�q1�q2�q3�q4�q5�q6�q7�q8�q9N)rr	r*rrhs   r�test_quoted�TestRio.test_quoted�sG������������

�������
&������r"c�d�[/5nURUS5 URUSL5 g)zDetect end of rio file.N)r	rrrs  r�test_read_empty�TestRio.test_read_empty�s+����O������D�!�����T�	�"r"c�<�UR[[S/5 g)z.File consisting of a nul byte causes an error.�N��assertRaises�
ValueErrorr	�rs r�test_read_nul_byte�TestRio.test_read_nul_byte�s�����*�k�E�7�;r"c�<�UR[[S/5 g)z2File consisting of many nul bytes causes an error.sdNr�r�s r�test_read_nul_bytes�TestRio.test_read_nul_bytes�s�����*�k�K�=�Ar"c
��[5nURS5 URS5 [U5n[	U5 [U5nUR
U[SS9[SSS9[SS	S9/5 g
)�Read several stanzas from file.s=version_header: 1

name: foo
val: 123

name: bar
val: 129319
r�1��version_header�foo�123�r�val�bar�129319N)rr4r5r
�iterrrr)rr8�reader�stuffs    r�test_read_iter�TestRio.test_read_iter�ss������
�
��	�	
�	�	�!���d�#���V���V��������c�*��E�u�-��E�x�0�
�	
r"c�.�[5nURS5 URS5 [U5nUR	U[SS95 [U5nUR	U[SSS95 [U5nUR	UR
S5S	5 UR	UR
S
5S5 [U5nUR	U[SS
S95 [U5nUR	US5 URU5 g)r�sversion_header: 1

name: foo
val: 123

name: quoted
address:   "Willowglen"
	  42 Wallaby Way
	  Sydney

name: bar
val: 129319
rr�r�r�r�r�r�quoted�addressz(  "Willowglen"
  42 Wallaby Way
  Sydneyr�r�N)rr4r5r	rrr�check_rio_filer7s   r�test_read_several�TestRio.test_read_several�s�������
�
�
�
	�	
�	�	�!����������F�#�6�7���������F��5�9�:�����������v���1�������y�)�+W�X���������F��8�<�=���������D�!����D�!r"c���URS5 [[U55R5nURS5 UR	X!R55 g)Nr)r5rrr6r)r�	real_file�
read_writes   rr��TestRio.check_rio_filesG�����q���i�	�2�3�8�8�:�
����q������^�^�%5�6r"c�4�[U5R5$�N)rr6)�stanzass r�stanzas_to_str�TestRio.stanzas_to_strs���� �%�%�'�'r"c�`�[[[U555nURX!5 gr�)rrrr)rr��new_stanzass   rrp�TestRio.rio_file_stanzass$���9�X�g�%6�7�8������.r"c�(�[5nURS5 URS5 /SQnUH\n[U5nUR	U/5 UR[
U5S5 URURS5U5 M^ g)Ns{s: "one"

s: 
	"one"
	

s: "

s: ""

s: """

s: 
	

s: \

s: 
	\
	\\
	

s: word\

s: quote"

s: backslashes\\\

s: both\"

r)z"one"z
"one"
rtruz"""rdr^z
\
\\
zword\zquote"zbackslashes\\\zboth\"�r)rr4r5r	rprrJr)rr8�
expected_vals�expected�stanzas     r�test_tricky_quoted�TestRio.test_tricky_quoteds�������
�
��	�@	
�	�	�!��

�
�&�H� ��&�F��!�!�6�(�+����S��[�!�,����V�Z�Z��_�h�7�	&r"c�j�[[5R55nURU/5 g)zWrite empty stanza.N)rrr*r)r�ls  r�test_write_empty_stanza�TestRio.test_write_empty_stanzaKs'�����"�"�$�%������B�r"c�\�[5nUR[URS05 g)�+TypeError on adding invalid type to Stanza.r�N�rr��	TypeErrorrWrs  r�test_rio_raises_type_error�"TestRio.test_rio_raises_type_errorPs!���H�����)�Q�U�U�E�2�6r"c�\�[5nUR[URS05 g)r��
Nr�rs  r�test_rio_raises_type_error_key�&TestRio.test_rio_raises_type_error_keyUs!���H�����)�Q�U�U�B��3r"c���SnUR[URS5 URSS5n[WS9nUR
URS5U5 UR5nUR
USURSS5-S-/5 [U5nUR
URS5U5 g![a UR	S5 N�f=f)	N��utf-8�surrogateescapez.surrogateescape is not available on Python < 3�r�r��foo: �
)r��UnicodeDecodeError�decode�LookupError�skipTestrrrr*�encoder	)r�	raw_bytes�uni_datar�	raw_lines�new_ss      r�test_rio_surrogateescape� TestRio.test_rio_surrogateescapeZs����	����,�i�.>�.>��H�	L� �'�'��1B�C�H�
�x� ��������u��x�0��J�J�L�	������8�?�?�7�<M�#N�N�QV�V�W�	
��I�&��������5�)�8�4���	L��M�M�J�K�	L�s�C�C%�$C%c�$�Sn[US9nURURS5U5 UR5nURUSUR	S5-S-/5 [U5nURURS5U5 g)Nuオr�r�r�r�r�)rrrr*r�r	)rr�rr�r�s     r�test_rio_unicode�TestRio.test_rio_unicodejs}��*���x� ��������u��x�0��J�J�L�	�����X�����0H�%H�5�%P�$Q�R��I�&��������5�)�8�4r"c��/nUHKn[R"SSU5nU(a[R"SSU5nURU5 MM U$)Ns *
r�s([^
])
s\1
)�re�sub�append)rrK�dos_nl�	new_lines�lines     r�
mail_munge�TestRio.mail_mungessN���	��D��6�6�'�5�$�/�D���v�v�l�J��=�����T�"�	�
�r"c��[SSSS9n[R"U5nUH2nURUS5 UR	[U5S:*5 M4 [R"USS9H nUR	[U5S:*5 M" [R"URUS	S
95nURU5n[R"U5nURSURS55 URSURS55 URSURS
55 g)Nz#

\r z�                                                                                                                                                                                                                                                               z�###############################################################################################################################################################################################################################################################)�datarm�hashs^# �H�)�	max_widthF)r�r�rmr�)
rr�to_patch_lines�assertContainsRerrJ�read_patch_stanzar�rr)rr�rKr��
new_stanzas     r�test_patch_rio�TestRio.test_patch_rio|s���[�	�	�J���"�"�6�*���D��!�!�$��/��O�O�C��I��O�,���&�&�v��<�D��O�O�C��I��O�,�=��*�*�4�?�?�5��?�+O�P�
�����&���*�*�5�1�
�����j�n�n�V�&<�=�����J�N�N�7�$;�<�����J�N�N�6�$:�;r"c�6�[SS9nUR[R"US5SS5 [SS9nUR[R"US5SS5 [S	S9nUR[R"US5SS5 g)
Nahlinebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/linebreak -/)�	breaktest�Grslinebreak\\
aJlinebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/linebreak-/�Fs
linebreak-\\
a,linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/linebreak/)rr�rr�)rr�s  r�test_patch_rio_linebreaks�!TestRio.test_patch_rio_linebreaks�s����"5�6�����c�0�0���<�Q�?�AS�T��"4�5�����c�0�0���<�Q�?�AT�U��"3�4�����c�0�0���<�Q�?�AS�Tr"�N)T)#�__name__�
__module__�__qualname__�__firstlineno__r r'r+r0r9r>rLr[rarirqrr�r�r�r�r�r��staticmethodr�rpr�r�r�r�r�r�r�r�r��__static_attributes__r�r"rr
r
"s���0�6�
Q�
?�
�" �"$�,@�" � � #�  �&#�<�B�
�2"�>7��(��(�/�58�n �
7�
4�
5� 5��
<�Ur"r
)�__doc__r��tempfiler�breezy.testsrr$rrrr	r
rr
r�r"r�<module>rs.��"�
�"�!��H�H�oU�h�oUr"

Youez - 2016 - github.com/yon3zu
LinuXploit