Ô/3q d Z ddlmZ ddlZddlZddlmZ ddlmZ ddlZddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlmZ G d de j Zd Zd
ZddZddZddZd ZddZ G d d Z G d de ZdS )zUtilities used in ODB testing )OStreamN)array)BytesIO)wrapsc 6 e Zd ZdZdZe fd Z xZS )TestBasezBase class for all tests
TestCase providing access to readonly repositories using the following member variables.
* gitrepopath
* read-only base path of the git source repository, i.e. .../git/.git
GITDB_TEST_GIT_REPO_BASEc t n# t $ r Y nw xY wt j | j | _ | j spt j d| j t j
j }t j
| | |t d | _ | j d sJ d S )NzpYou can set the %s environment variable to a .git repository of your choice - defaulting to the gitdb repositoryz.git)super
setUpClassAttributeErrorosenvirongetk_env_git_repogitrepopathlogginginfopathdirnamejoin__file__endswith)clsospd __class__s `/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/gitdb/test/lib.pyr zTestBase.setUpClass( s GG D *..);<< OL C EH EW
X
X
X7?D gll44TT(^^0D0D+E+EvNNCO''///////s $
11)__name__
__module____qualname____doc__r classmethodr
__classcell__)r s @r r r sU 0N
0
0
0
0 [
0
0
0
0
0 r c * fd} j |_ |S )zCreate a temporary directory which can be written to, remove it if the
test succeeds, but leave it otherwise to aid additional debuggingc
t j j }t j | d} | | |s(t j t j | S S # t $ rD t j dt | j dj d|d d} w xY w# |s(t j t j | w w xY w)N)prefixFzTest .z failed, output is at
T)tempfilemktempr r mkdirgccollectshutilrmtree Exceptionsysstderrwritetype)selfr keepfuncs r wrapperz"with_rw_directory.