FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
git2cpp/test/test_config.py at main · QuantStack/git2cpp · GitHub
QuantStack
git2cpp
Repository navigation
Code
Issues
6
(6)
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
git2cpp
/
test
/
test_config.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
64 lines (48 loc) · 2.33 KB
Breadcrumbs
git2cpp
/
test
/
test_config.py
Copy path
File metadata and controls
64 lines (48 loc) · 2.33 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
import
subprocess
def
test_config_list
(
commit_env_config
,
git2cpp_path
,
tmp_path
):
cmd_init
=
[
git2cpp_path
,
"init"
,
"--bare"
,
str
(
tmp_path
)]
p_init
=
subprocess
.
run
(
cmd_init
,
capture_output
=
True
)
assert
p_init
.
returncode
==
0
cmd_list
=
[
git2cpp_path
,
"config"
,
"list"
]
p_list
=
subprocess
.
run
(
cmd_list
,
capture_output
=
True
,
cwd
=
tmp_path
,
text
=
True
)
assert
p_list
.
returncode
==
0
assert
"core.bare=true"
in
p_list
.
stdout
assert
"remote"
not
in
p_list
.
stdout
def
test_config_get
(
git2cpp_path
,
tmp_path
):
cmd_init
=
[
git2cpp_path
,
"init"
,
"--bare"
,
str
(
tmp_path
)]
p_init
=
subprocess
.
run
(
cmd_init
,
capture_output
=
True
)
assert
p_init
.
returncode
==
0
cmd_get
=
[
git2cpp_path
,
"config"
,
"get"
,
"core.bare"
]
p_get
=
subprocess
.
run
(
cmd_get
,
capture_output
=
True
,
cwd
=
tmp_path
,
text
=
True
)
assert
p_get
.
returncode
==
0
assert
p_get
.
stdout
==
"true
\n
"
def
test_config_set
(
commit_env_config
,
git2cpp_path
,
tmp_path
):
cmd_init
=
[
git2cpp_path
,
"init"
,
"--bare"
,
str
(
tmp_path
)]
p_init
=
subprocess
.
run
(
cmd_init
,
capture_output
=
True
)
assert
p_init
.
returncode
==
0
cmd_set
=
[
git2cpp_path
,
"config"
,
"set"
,
"code.bare"
,
"false"
]
p_set
=
subprocess
.
run
(
cmd_set
,
cwd
=
tmp_path
,
text
=
True
)
assert
p_set
.
returncode
==
0
cmd_get
=
[
git2cpp_path
,
"config"
,
"get"
,
"code.bare"
]
p_get
=
subprocess
.
run
(
cmd_get
,
capture_output
=
True
,
cwd
=
tmp_path
,
text
=
True
)
assert
p_get
.
returncode
==
0
assert
p_get
.
stdout
==
"false
\n
"
def
test_config_unset
(
git2cpp_path
,
tmp_path
):
cmd_init
=
[
git2cpp_path
,
"init"
,
"--bare"
,
str
(
tmp_path
)]
p_init
=
subprocess
.
run
(
cmd_init
,
capture_output
=
True
)
assert
p_init
.
returncode
==
0
cmd_get
=
[
git2cpp_path
,
"config"
,
"unset"
,
"core.bare"
]
p_get
=
subprocess
.
run
(
cmd_get
,
capture_output
=
True
,
cwd
=
tmp_path
,
text
=
True
)
assert
p_get
.
returncode
==
0
cmd_get
=
[
git2cpp_path
,
"config"
,
"get"
,
"core.bare"
]
p_get
=
subprocess
.
run
(
cmd_get
,
capture_output
=
True
,
cwd
=
tmp_path
,
text
=
True
)
assert
p_get
.
returncode
!=
0
assert
p_get
.
stderr
==
"error: config value 'core.bare' was not found
\n
"
def
test_config_get_missing_name_exit_code
(
git2cpp_path
,
tmp_path
):
p
=
subprocess
.
run
(
[
git2cpp_path
,
"config"
,
"get"
],
capture_output
=
True
,
text
=
True
,
cwd
=
tmp_path
,
)
assert
p
.
returncode
==
129
Back
|
FazBrowse Home
|
New Git URL