Skip to content

Commit

Permalink
test: verify call_git_oneline() always raises for anything but a si…
Browse files Browse the repository at this point in the history
…ngle line

The previous commit homogenized the exception to always be
`AssertionError`.
  • Loading branch information
mih committed Oct 28, 2024
1 parent c8dc6e4 commit d48a9d9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions datalad_core/runners/tests/test_callgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ def test_call_git_lines():
def test_call_git_oneline():
line = call_git_oneline(['--version'])
assert line.startswith('git version')
# raise when there is more than oneline
with pytest.raises(AssertionError):
# TODO: may not yield multiple lines on all systems
call_git_oneline(['config', '-l'])
call_git_oneline(['rev-parse', '--git-dir', '--git-common-dir'])
# raise when there is no line
with pytest.raises(AssertionError):
call_git_oneline(
['stripspace'],
inputs='',
)


def test_iter_git_subproc():
Expand Down

0 comments on commit d48a9d9

Please sign in to comment.