Skip to content

Commit

Permalink
Fix the test on brew since we could have brew --install call as well
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Apr 25, 2024
1 parent 470882a commit c753da8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,17 @@ def test_install_git_annex_brew(mocker: MockerFixture) -> None:
spy = mocker.spy(datalad_installer, "runcmd")
r = main(["datalad_installer.py", "git-annex", "-m", "brew"])
assert r == 0
assert spy.call_args_list[-1] == mocker.call("brew", "install", "git-annex")

# where to look for the "brew install" invocation
target_index = -1
# we might have checked also for the brew --prefix
if spy.call_args_list[-1] == mocker.call(
"brew", "--prefix", stdout=-1, universal_newlines=True
):
target_index -= 1
assert spy.call_args_list[target_index] == mocker.call(
"brew", "install", "git-annex"
)
assert shutil.which("git-annex") is not None


Expand Down

0 comments on commit c753da8

Please sign in to comment.