FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
git2cpp/test/test_git.py at 0.0.8 · 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_git.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (37 loc) · 1.66 KB
Breadcrumbs
git2cpp
/
test
/
test_git.py
Copy path
File metadata and controls
45 lines (37 loc) · 1.66 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
import
pytest
import
re
import
subprocess
from
.
conftest
import
GIT2CPP_TEST_WASM
@
pytest
.
mark
.
parametrize
(
"arg"
, [
"-v"
,
"--version"
])
def
test_version
(
git2cpp_path
,
arg
):
cmd
=
[
git2cpp_path
,
arg
]
p
=
subprocess
.
run
(
cmd
,
capture_output
=
True
)
assert
p
.
returncode
==
0
assert
p
.
stderr
==
b""
assert
p
.
stdout
.
startswith
(
b"git2cpp version "
)
assert
p
.
stdout
.
count
(
b"
\n
"
)
==
1
def
test_error_on_unknown_option
(
git2cpp_path
):
cmd
=
[
git2cpp_path
,
"--unknown"
]
p
=
subprocess
.
run
(
cmd
,
capture_output
=
True
)
assert
p
.
returncode
==
109
assert
p
.
stdout
==
b""
assert
p
.
stderr
.
startswith
(
b"The following argument was not expected: --unknown"
)
@
pytest
.
mark
.
skipif
(
not
GIT2CPP_TEST_WASM
,
reason
=
"Only test in WebAssembly"
)
def
test_cockle_config
(
git2cpp_path
):
# Check cockle-config shows git2cpp is available.
cmd
=
[
"cockle-config"
,
"module"
,
"git2cpp"
]
p
=
subprocess
.
run
(
cmd
,
capture_output
=
True
,
text
=
True
)
assert
p
.
returncode
==
0
lines
=
[
line
for
line
in
re
.
split
(
r"\r?\n"
,
p
.
stdout
)
if
len
(
line
)
>
0
]
assert
len
(
lines
)
==
5
assert
lines
[
1
]
==
"│ module │ package │ cached │"
assert
lines
[
3
]
==
"│ git2cpp │ git2cpp │ │"
p
=
subprocess
.
run
([
git2cpp_path
,
"-v"
],
capture_output
=
True
,
text
=
True
)
assert
p
.
returncode
==
0
# Check git2cpp module has been cached.
p
=
subprocess
.
run
(
cmd
,
capture_output
=
True
,
text
=
True
)
assert
p
.
returncode
==
0
lines
=
[
line
for
line
in
re
.
split
(
r"\r?\n"
,
p
.
stdout
)
if
len
(
line
)
>
0
]
assert
len
(
lines
)
==
5
assert
lines
[
1
]
==
"│ module │ package │ cached │"
assert
lines
[
3
]
==
"│ git2cpp │ git2cpp │ yes │"
Back
|
FazBrowse Home
|
New Git URL