mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix(test_mac_brew_pkg): adapt test to also mock path.which
Signed-off-by: Antonio Ramón Sánchez Morales <antonioramonsm@gmail.com>
This commit is contained in:
parent
2199d8503b
commit
4ac4da9aa4
1 changed files with 3 additions and 2 deletions
|
@ -440,8 +440,9 @@ def test_homebrew_bin(HOMEBREW_BIN):
|
|||
Tests the path to the homebrew binary
|
||||
"""
|
||||
mock_path = MagicMock(return_value="/usr/local")
|
||||
with patch.dict(mac_brew.__salt__, {"cmd.run": mock_path}):
|
||||
assert mac_brew._homebrew_bin() == HOMEBREW_BIN
|
||||
with patch("salt.utils.path.which", MagicMock(return_value=HOMEBREW_BIN)):
|
||||
with patch.dict(mac_brew.__salt__, {"cmd.run": mock_path}):
|
||||
assert mac_brew._homebrew_bin() == HOMEBREW_BIN
|
||||
|
||||
|
||||
# 'list_pkgs' function tests: 2
|
||||
|
|
Loading…
Add table
Reference in a new issue