FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
GitPython/test/test_installation.py at 3.1.38 · gitpython-developers/GitPython · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
gitpython-developers
/
GitPython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
989
Star
5.2k
Code
Issues
8
Pull requests
2
Discussions
Actions
Security and quality
34
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
GitPython
/
test
/
test_installation.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
56 lines (51 loc) · 2.01 KB
Breadcrumbs
GitPython
/
test
/
test_installation.py
Copy path
File metadata and controls
56 lines (51 loc) · 2.01 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
# This module is part of GitPython and is released under
# the BSD License: https://opensource.org/license/bsd-3-clause/
import
ast
import
os
import
subprocess
import
sys
from
git
.
compat
import
is_win
from
test
.
lib
import
TestBase
from
test
.
lib
.
helper
import
with_rw_directory
class
TestInstallation
(
TestBase
):
def
setUp_venv
(
self
,
rw_dir
):
self
.
venv
=
rw_dir
subprocess
.
run
([
sys
.
executable
,
"-m"
,
"venv"
,
self
.
venv
],
stdout
=
subprocess
.
PIPE
)
bin_name
=
"Scripts"
if
is_win
else
"bin"
self
.
python
=
os
.
path
.
join
(
self
.
venv
,
bin_name
,
"python"
)
self
.
pip
=
os
.
path
.
join
(
self
.
venv
,
bin_name
,
"pip"
)
self
.
sources
=
os
.
path
.
join
(
self
.
venv
,
"src"
)
self
.
cwd
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
os
.
symlink
(
self
.
cwd
,
self
.
sources
,
target_is_directory
=
True
)
@
with_rw_directory
def
test_installation
(
self
,
rw_dir
):
self
.
setUp_venv
(
rw_dir
)
result
=
subprocess
.
run
(
[
self
.
pip
,
"install"
,
"."
],
stdout
=
subprocess
.
PIPE
,
cwd
=
self
.
sources
,
)
self
.
assertEqual
(
0
,
result
.
returncode
,
msg
=
result
.
stderr
or
result
.
stdout
or
"Can't install project"
,
)
result
=
subprocess
.
run
([
self
.
python
,
"-c"
,
"import git"
],
stdout
=
subprocess
.
PIPE
,
cwd
=
self
.
sources
)
self
.
assertEqual
(
0
,
result
.
returncode
,
msg
=
result
.
stderr
or
result
.
stdout
or
"Selftest failed"
,
)
result
=
subprocess
.
run
(
[
self
.
python
,
"-c"
,
"import sys;import git; print(sys.path)"
],
stdout
=
subprocess
.
PIPE
,
cwd
=
self
.
sources
,
)
syspath
=
result
.
stdout
.
decode
(
"utf-8"
).
splitlines
()[
0
]
syspath
=
ast
.
literal_eval
(
syspath
)
self
.
assertEqual
(
""
,
syspath
[
0
],
msg
=
"Failed to follow the conventions for https://docs.python.org/3/library/sys.html#sys.path"
,
)
self
.
assertTrue
(
syspath
[
1
].
endswith
(
"gitdb"
),
msg
=
"Failed to add gitdb to sys.path"
)
Back
|
FazBrowse Home
|
New Git URL