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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/dulwich/tests/__pycache__/utils.cpython-313.pyc
�

mEdg�0����SrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKJ	r	 SSK
Jr SSKJ
r
JrJrJr SSKJrJrJrJrJrJrJrJr SSKJr SrSS	jrSS
jrSrSr S
r!Sr"Sr#SSjr$SSjr%Sr&g)z*Utility functions common to Dulwich tests.�N)�SkipTest)�commit_tree)�Commit�FixedSha�Tag�object_class)�DELTA_TYPES�	OFS_DELTA�	REF_DELTA�
SHA1Writer�create_delta�obj_sha�write_pack_header�write_pack_object)�Repoi��c�:�Uc[R"5n[RR	[RR[5SSSSU5n[RR	X5n[R"X#SS9 [U5$)a�Open a copy of a repo in a temporary directory.

Use this function for accessing repos in dulwich/tests/data/repos to avoid
accidentally or intentionally modifying those repos in place. Use
tear_down_repo to delete any temp files created.

Args:
  name: The name of the repository, relative to
    dulwich/tests/data/repos
  temp_dir: temporary directory to initialize to. If not provided, a
    temporary directory will be created.
Returns: An initialized Repo object that lives in a temporary directory.
z..�testdata�reposT)�symlinks)
�tempfile�mkdtemp�os�path�join�dirname�__file__�shutil�copytreer)�name�temp_dir�repo_dir�
temp_repo_dirs    �5/usr/lib/python3/dist-packages/dulwich/tests/utils.py�	open_repor$3sq�����#�#�%���w�w�|�|�
������!�4��z�7�D��H��G�G�L�L��0�M�
�O�O�H�d�;��
���c���UR5 [RRURR	[R
55n[R"U5 g)zTear down a test repository.N)�closerrr�rstrip�sepr�rmtree)�repor s  r#�tear_down_repor,Ks<���J�J�L��w�w���t�y�y�/�/����7�8�H�
�M�M�(�r%c��^�"SSU5nSUR-UlU"5nUR5H/upEUS:Xa[U5mU4SjUlM#[	X4U5 M1 U$)a0Make an object for testing and assign some members.

This method creates a new subclass to allow arbitrary attribute
reassignment, which is not otherwise possible with objects having
__slots__.

Args:
  attrs: dict of attributes to set on the new object.
Returns: A newly initialized object of type cls.
c��\rSrSrSrSrg)�make_object.<locals>.TestObject�^z�Class that inherits from the given class, but without __slots__.

Note that classes with __slots__ can't have arbitrary attributes
monkey-patched in, so this is a class that is exactly the same only
with a __dict__ instead of __slots__.
�N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r1r%r#�
TestObjectr/^s��	r%r8�TestObject_�idc�>�T$�Nr1)�shas�r#�<lambda>�make_object.<locals>.<lambda>ms���cr%)r2�itemsrr=�setattr)�cls�attrsr8�objr�valuer=s      @r#�make_objectrFRsc����S��(�#�,�,�6�J��
�,�C��{�{�}����4�<��5�/�C�!�C�G��C�u�%�
%��Jr%c
�`�SnSUSSUSS/SS.	nURU5 [[40UD6$)z�Make a Commit object with a default set of members.

Args:
  attrs: dict of attributes to overwrite from the default values.
Returns: A newly initialized Commit object.
i;=K�Test Author <test@nodomain.com>rs"Test Committer <test@nodomain.com>�
Test message.s(0000000000000000000000000000000000000000)	�author�author_time�author_timezone�	committer�commit_time�commit_timezone�message�parents�tree)�updaterFr)rC�default_time�	all_attrss   r#�make_commitrVssK���L�4�#��:�#��#���
�I����U���v�+��+�+r%c	� �URn[UR5n[[R
"[R"SSS5R555nSUSSX24SS.nURU5 [[40UD6$)z�Make a Tag object with a default set of values.

Args:
  target: object to be tagged (Commit, Blob, Tree, etc)
  attrs: dict of attributes to overwrite from the default values.
Returns: A newly initialized Tag object.
i��rHrrIsTest Tag)�tagger�tag_time�tag_timezonerP�objectr)r:r�	type_name�int�time�mktime�datetime�	timetuplerSrFr)�targetrC�	target_id�target_typerTrUs      r#�make_tagrf�s����	�	�I��v�/�/�0�K��t�{�{�8�#4�#4�T�1�a�#@�#J�#J�#L�M�N�L�4� ��#��*��
�I����U���s�(�i�(�(r%c�^^�SUU4SjjnU$)z5Generate a test method that tests the given function.c�>�T"UT5 gr<r1��self�func�methods ��r#�do_test�!functest_builder.<locals>.do_test�s
����t�T�r%��returnNr1�rlrkrms`` r#�functest_builderrr�s������Nr%c�^^�SUU4SjjnU$)a�Generate a test method that tests the given extension function.

This is intended to generate test methods that test both a pure-Python
version and an extension version using common test code. The extension test
will raise SkipTest if the extension is not found.

Sample usage:

class MyTest(TestCase);
    def _do_some_test(self, func_impl):
        self.assertEqual('foo', func_impl())

    test_foo = functest_builder(_do_some_test, foo_py)
    test_foo_extension = ext_functest_builder(_do_some_test, _foo_c)

Args:
  method: The method to run. It must must two parameters, self and the
    function implementation to test.
  func: The function implementation to pass to method.
c�r>�[T[R5(d[TS35eT"UT5 g)Nz extension not found)�
isinstance�types�BuiltinFunctionTyperris ��r#rm�%ext_functest_builder.<locals>.do_test�s3����$�� 9� 9�:�:��d�V�#7�8�9�9��t�T�r%ror1rqs`` r#�ext_functest_builderry�s���,��
�Nr%c	�8�[U5n[U5n[URU5 0n0n0n[U5U:a�[	U5Hqunup�U	[
;aX�[
X�/54XX'M$U
up�[U[5(aX�;aMDX[un n
OURU5up�UU
[
X�/54XX'Ms [U5U:aM�[	U5H�unup�UR5nU	[:Xa-Uunn
X�U-
nUUun
nn
U[[UU
554nOeU	[:Xa[Uunn
[U[5(a
UUun
nnO URU5unn[
UU5nU[[UU
554n[URX�5nX�U'UXx'M� /n[!U5H4nXXup�n[U5S:XdeUR#XhX�UXx45 M6 UR%5 UR'S5 U$)aWrite test pack data from a concise spec.

Args:
  f: A file-like object to write the pack to.
  objects_spec: A list of (type_num, obj). For non-delta types, obj
    is the string of that object's data.
    For delta types, obj is a tuple of (base, data), where:

    * base can be either an index in objects_spec of the base for that
    * delta; or for a ref delta, a SHA, in which case the resulting pack
    * will be thin and the base will be an external ref.
    * data is a string of the full, non-deltified data for that object.

    Note that offsets/refs and deltas are computed within this function.
  store: An optional ObjectStore for looking up external refs.
Returns: A list of tuples in the order specified by objects_spec:
    (offset, type num, data, sha, CRC32)
�r)r�lenr�write�	enumerater	rrur^�get_raw�tellr
�listr
rr�range�append�	write_sha�seek)�f�objects_spec�store�sf�num_objects�full_objects�offsets�crc32s�i�type_num�data�base�
base_type_num�_rD�offset�
base_index�	base_data�base_ref�crc32�expectedr=s                      r#�
build_packr��s+��&
�A��B��l�#�K��b�h�h��,��L��G�
�F�

�l�
�k�
)�#,�\�#:��A����{�*�#+�7�8�V�3L�"M�����J�D��$��$�$��+��&2�&8�#�
�q�!�#(�=�=��#6� �
����
�v�.��L�O�$;��l�
�k�
)�$(��5���?�H�������y� �"��J���J�/�/�D�*�:�6�O�A�y�!���l�9�d�;�<�=�C�
��
"� �N�H�d��(�C�(�(�%1�(�%;�"��9�d�+0�=�=��+B�(�
�y��}�i�8����l�9�d�;�<�=�C�!�"�(�(�H�:����
���	�%6�(�H�
�;�
��*�o�����3�x�2�~��~������X�S�&�)�D�E� �
�L�L�N��F�F�1�I��Or%c���Uc0nUc0nSn0n/nUGHnUSnUSSV	s/sHo�U	PM	 n
n	/n
URU/5HUn[	U5S:XaUunnUU[
4nUunnnU
R
UURU45 URU5 MW [X
5nSU3RS5U
UUS.nURURU055 [S0UD6nUS	S
-nURXX'URU5 UR
U5 GM U$s sn	f![a"nURun[SU35UeSnAff=f)a)Build a commit graph from a concise specification.

Sample usage:
>>> c1, c2, c3 = build_commit_graph(store, [[1], [2, 1], [3, 1, 2]])
>>> store[store[c3].parents[0]] == c1
True
>>> store[store[c3].parents[1]] == c2
True

If not otherwise specified, commits will refer to the empty tree and have
commit times increasing in the same order as the commit spec.

Args:
  object_store: An ObjectStore to commit objects to.
  commit_spec: An iterable of iterables of ints defining the commit
    graph. Each entry defines one commit, and entries must be in
    topological order. The first element of each entry is a commit number,
    and the remaining elements are its parents. The commit numbers are only
    meaningful for the call to make_commits; since real commit objects are
    created, they will get created with real, opaque SHAs.
  trees: An optional dict of commit number -> tree spec for building
    trees for commits. The tree spec is an iterable of (path, blob, mode)
    or (path, blob) entries; if mode is omitted, it defaults to the normal
    file mode (0100644).
  attrs: A dict of commit number -> (dict of attribute -> value) for
    assigning additional values to the commits.
Returns: The list of commit objects created.

Raises:
  ValueError: If an undefined commit identifier is listed as a parent.
NrrXzUnknown parent �zCommit �ascii)rPrQrRrNrN�dr1)
�KeyError�args�
ValueError�getr|�Fr�r:�
add_objectr�encoderSrV)�object_store�commit_spec�treesrCrN�nums�commits�commit�
commit_num�pn�
parent_ids�exc�missing_parent�blobs�entryr�blob�mode�tree_id�commit_attrs�
commit_objs                     r#�build_commit_graphr�s���@
�}����}����K�
�D��G����A�Y�
�	J�-3�A�B�Z�8�Z�r�r�(�Z�J�8�
���Y�Y�z�2�.�E��5�z�Q��"�
��d��t�Q���$��D�$���L�L�$�����.�/��#�#�D�)�
/��l�2��"�*��.�6�6�w�?�!��&�	
��	���E�I�I�j�"�5�6� �0�<�0�
�#�=�1�C�7��%�=�=������
�+����z�"�A�D�N��?9���	J� #����^���~�.>�?�@�c�I��	J�s'�D5�D0�D5�0D5�5
E!�?E�E!c�h^^�/m[RmSU4SjjnU[lSU4SjjnTU4$)z:Wrap warnings.showwarning with code that records warnings.c�.>�TRUS5 g)Nr)r�)r��kwargs�caught_warningss  �r#�custom_showwarning�1setup_warning_catcher.<locals>.custom_showwarningfs������t�A�w�'r%c�>�T[lgr<��warnings�showwarning)�original_showwarnings�r#�restore_showwarning�2setup_warning_catcher.<locals>.restore_showwarningks���3��r%ror�)r�r�r�r�s  @@r#�setup_warning_catcherr�as6����O�#�/�/��(�.�H��4��/�/�/r%r<ro)NN)'r6rarrrr_rvr��unittestr�
dulwich.indexr�dulwich.objectsrrrr�dulwich.packr	r
rrr
rrr�dulwich.reporr�r$r,rFrVrfrrryr�r�r�r1r%r#�<module>r�s}��,1��	�
������%�?�?�	�	�	��
���0��B,�.)�.��<I�XJ�Z
0r%

Youez - 2016 - github.com/yon3zu
LinuXploit