FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
GitPython/git/test/performance/lib.py at 0.3.3 · gitpython-developers/GitPython · GitHub
gitpython-developers
GitPython
Repository navigation
Code
Issues
1
(1)
Pull requests
Discussions
Actions
Security and quality
42
(42)
Insights
Expand file tree
Breadcrumbs
GitPython
/
git
/
test
/
performance
/
lib.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
84 lines (63 loc) · 2.12 KB
Breadcrumbs
GitPython
/
git
/
test
/
performance
/
lib.py
Copy path
File metadata and controls
84 lines (63 loc) · 2.12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
"""Contains library functions"""
import
os
from
git
.
test
.
lib
import
(
TestBase
)
from
gitdb
.
test
.
lib
import
skip_on_travis_ci
import
shutil
import
tempfile
import
logging
from
git
.
db
import
(
GitCmdObjectDB
,
GitDB
)
from
git
import
(
Repo
)
#{ Invvariants
k_env_git_repo
=
"GIT_PYTHON_TEST_GIT_REPO_BASE"
#} END invariants
#{ Base Classes
class
TestBigRepoR
(
TestBase
):
"""TestCase providing access to readonly 'big' repositories using the following
member variables:
* gitrorepo
* Read-Only git repository - actually the repo of git itself
* puregitrorepo
* As gitrepo, but uses pure python implementation
"""
#{ Invariants
#} END invariants
def
setUp
(
self
):
# This will raise on travis, which is what we want to happen early as to prevent us to do any work
skip_on_travis_ci
(
lambda
*
args
:
None
)(
self
)
try
:
super
(
TestBigRepoR
,
self
).
setUp
()
except
AttributeError
:
pass
repo_path
=
os
.
environ
.
get
(
k_env_git_repo
)
if
repo_path
is
None
:
logging
.
info
(
(
"You can set the %s environment variable to a .git repository of"
%
k_env_git_repo
)
+
"your choice - defaulting to the gitpython repository"
)
repo_path
=
os
.
path
.
dirname
(
__file__
)
# end set some repo path
self
.
gitrorepo
=
Repo
(
repo_path
,
odbt
=
GitCmdObjectDB
)
self
.
puregitrorepo
=
Repo
(
repo_path
,
odbt
=
GitDB
)
class
TestBigRepoRW
(
TestBigRepoR
):
"""As above, but provides a big repository that we can write to.
Provides ``self.gitrwrepo`` and ``self.puregitrwrepo``"""
def
setUp
(
self
):
self
.
gitrwrepo
=
None
try
:
super
(
TestBigRepoRW
,
self
).
setUp
()
except
AttributeError
:
pass
dirname
=
tempfile
.
mktemp
()
os
.
mkdir
(
dirname
)
self
.
gitrwrepo
=
self
.
gitrorepo
.
clone
(
dirname
,
shared
=
True
,
bare
=
True
,
odbt
=
GitCmdObjectDB
)
self
.
puregitrwrepo
=
Repo
(
dirname
,
odbt
=
GitDB
)
def
tearDown
(
self
):
if
self
.
gitrwrepo
is
not
None
:
shutil
.
rmtree
(
self
.
gitrwrepo
.
working_dir
)
#} END base classes
Back
|
FazBrowse Home
|
New Git URL