def test_install(self):
        mock_pkg = MagicMock(side_effect=MinionError)
        with patch.dict(pkgutil.__salt__,
                        {'pkg_resource.parse_targets': mock_pkg}):
            self.assertRaises(CommandExecutionError, pkgutil.install)

        mock_ret = MagicMock(return_value=True)
        mock_pkg = MagicMock(return_value=[''])
        with patch.dict(pkgutil.__salt__,
                        {'pkg_resource.parse_targets': mock_pkg}):
            with patch.dict(pkgutil.__context__, {'pkg.list_pkgs': mock_ret}):
                self.assertDictEqual(pkgutil.install(), {})

        mock_run = MagicMock(return_value='A\t B\t SAME')
        mock_run_all = MagicMock(return_value={'stdout': ''})
        mock_pkg = MagicMock(return_value=[{"bar": "1.2.3"}])
        with patch.dict(pkgutil.__salt__,
                        {'pkg_resource.parse_targets': mock_pkg,
                         'pkg_resource.stringify': mock_pkg,
                         'pkg_resource.sort_pkglist': mock_pkg,
                         'cmd.run_all': mock_run_all, 'cmd.run': mock_run}):
            with patch.dict(pkgutil.__context__, {'pkg.list_pkgs': mock_ret}):
                self.assertDictEqual(pkgutil.install
                                     (pkgs='["foo", {"bar": "1.2.3"}]'), {})

    # 'remove' function tests: 1
Test if it install packages using the pkgutil tool.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/pkgutil_test.py/PkgutilTestCase.test_install