/
githubmirror
/
salt
Обзор
Документация
Войти
/
githubmirror
/
salt
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/pytests/unit/modules/test_mac_pkgutil.py
35 строк
991 B
Pedro Algarvio
Update to isort 5.10.1
01 авг 2022, 21:49
01 авг 2022, 21:49
4d49013
Код
Авторство
О чём код?
import pytest import salt.modules.mac_pkgutil as mac_pkgutil from tests.support.mock import patch @pytest.fixture def configure_loader_modules(): return {mac_pkgutil: {}} def test_install(): source = "/foo/bar/fubar.pkg" package_id = "com.foo.fubar.pkg" with patch("salt.modules.mac_pkgutil.is_installed", return_value=False): with patch( "salt.modules.mac_pkgutil._install_from_path", return_value=True ) as _install_from_path: mac_pkgutil.install(source, package_id) _install_from_path.assert_called_with(source) def test_install_already_there(): source = "/foo/bar/fubar.pkg" package_id = "com.foo.fubar.pkg" with patch("salt.modules.mac_pkgutil.is_installed", return_value=True): with patch( "salt.modules.mac_pkgutil._install_from_path", return_value=True ) as _install_from_path: mac_pkgutil.install(source, package_id) assert _install_from_path.called == 0