def test_install_wildcard(self): """ Test installing a PKG file with a wildcard """ mock = MagicMock() with patch.dict(macpackage.__salt__, {"cmd.run_all": mock}): macpackage.install("/path/to/*.pkg") mock.assert_called_once_with( "installer -pkg /path/to/*.pkg -target LocalSystem", python_shell=True)
def test_install_wildcard(self): ''' Test installing a PKG file with a wildcard ''' mock = MagicMock() with patch.dict(macpackage.__salt__, {'cmd.run_all': mock}): macpackage.install('/path/to/*.pkg') mock.assert_called_once_with( 'installer -pkg /path/to/*.pkg -target LocalSystem', python_shell=True)
def test_install_with_extras(self): ''' Test installing a PKG file with extra options ''' mock = MagicMock() with patch.dict(macpackage.__salt__, {'cmd.run_all': mock}): macpackage.install('/path/to/file.pkg', store=True, allow_untrusted=True) mock.assert_called_once_with( 'installer -pkg /path/to/file.pkg -target LocalSystem -store -allowUntrusted', python_shell=False)
def test_install_with_extras(): """ Test installing a PKG file with extra options """ mock = MagicMock() with patch.dict(macpackage.__salt__, {"cmd.run_all": mock}): macpackage.install("/path/to/file.pkg", store=True, allow_untrusted=True) mock.assert_called_once_with( "installer -pkg /path/to/file.pkg -target LocalSystem -store" " -allowUntrusted", python_shell=False, )