Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
gitdb
/
test
/
__pycache__
/
File Content:
test_util.cpython-311.opt-1.pyc
� � h� � �Z � d Z ddlZddlZddlmZ ddlmZmZmZm Z G d� de� � Z dS )zTest for object db� N)�TestBase)� to_hex_sha� to_bin_sha�NULL_HEX_SHA�LockedFDc � � e Zd Zd� Zd� Zd� ZdS )� TestUtilsc � � d S )N� )�selfs �I/opt/cloudlinux/venv/lib/python3.11/site-packages/gitdb/test/test_util.py�test_basicszTestUtils.test_basics s � � � � c �X � t |d� � 5 }d d d � � d S # 1 swxY w Y d S )N�rb)�open)r � file_path�data�fps r � _cmp_contentszTestUtils._cmp_contents su � � �)�T� "� "� 5�b� 5� 5� 5� 5� 5� 5� 5� 5� 5� 5� 5� 5���� 5� 5� 5� 5� 5� 5s ��#�#c �l � t j � � }d}d}t |d� � 5 }|� |� d� � � � d d d � � n# 1 swxY w Y t |� � }|� � � }| � t |j � � | � t |j � � |� d�� � }t j ||� d� � � � |� � � | � ||� � |� � � |� � � t |� � }|� d�� � }~t |� � }t |� � } |� dd�� � } | � t | j � � | � |� d� � � � |� � � | � ||� � t j |� � n# t j |� � w xY wt t j � � � � } |� d�� � | � d � � d S # t $ r Y d S w xY w) N�hello�world�wb�asciiT)�writeF)r �streamzexpected OSError)�tempfile�mktempr r �encoder � _lockfilepath�assertRaises�AssertionError�rollback�commit�osr �IOError�remove�fail�OSError)r �my_file� orig_data�new_data� my_file_fp�lfd�lockfilepath�wfd�rfd�olfd� wfdstreams r � test_lockedfdzTestUtils.test_lockedfd s� � ��/�#�#��� ��� �'�4� � � 8�J����Y�-�-�g�6�6�7�7�7� 8� 8� 8� 8� 8� 8� 8� 8� 8� 8� 8���� 8� 8� 8� 8�3 ��7�#�#�C��,�,�.�.�L� ���n�c�l�;�;�;����n�c�j�9�9�9� �(�(��(�&�&�C� �H�S�(�/�/�'�2�2�3�3�3��L�L�N�N�N����w� �2�2�2� �J�J�L�L�L��L�L�N�N�N� �7�#�#�C��(�(��(�'�'�C� � �7�#�#�C��G�$�$�D����t�D��9�9�I� ���g�t�y�1�1�1��O�O�H�O�O�G�4�4�5�5�5��J�J�L�L�L����w��1�1�1� �I�g������B�I�g�������� �x��(�(�)�)�� *��H�H�5�H�!�!�!� �I�I�(�)�)�)�)�)�� � ;� ;� ;� ;� ;� ;� ;���s0 �)A�A!�$A!�)G H>