Module Expr Str ImportFrom alias ImportFrom alias alias ImportFrom alias alias alias alias ImportFrom alias Expr Call NameLoad Str ImportFrom alias ImportFrom alias alias Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword Num With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Assign NameStore Call NameLoad keyword ListLoad Str NameLoad With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword Str Assign NameStore Call NameLoad keyword Num With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword Str Assign NameStore Call NameLoad keyword Num Assign NameStore Call NameLoad keyword Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword Str Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Dict Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call NameLoad keyword NameLoad With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword NameLoad With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad keyword Str Assign NameStore Call NameLoad keyword Dict Str Str Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Dict Str Str Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword NameLoad With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword ListLoad Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Assign NameStore Call NameLoad keyword Str Assign NameStore Call NameLoad keyword Dict Str Str Assign NameStore Call NameLoad keyword ListLoad Dict Str Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Str Dict decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword NameLoad With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword Str Assign NameStore Call NameLoad keyword Dict Str Str Assign NameStore Call NameLoad keyword ListLoad Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Assign NameStore Call NameLoad keyword ListLoad Dict Str Str With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body With Call AttributeLoad NameLoad attr NameLoad Str keyword Dict Str Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr keyword Str Dict decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword NameLoad With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Dict Str NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list decorator_list Call NameLoad NameLoad NameLoad If CompareEq NameLoad Str body ImportFrom alias Expr Call NameLoad NameLoad keyword NameLoad
N/A N/A 
    :codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
 __future__ absolute_import salttesting TestCase skipIf salttesting.mock MagicMock patch NO_MOCK NO_MOCK_REASON salttesting.helpers ensure_in_syspath N/A N/A ensure_in_syspath ../../ salt.modules pkgutil salt.exceptions CommandExecutionError MinionError N/A N/A pkgutil __salt__ N/A N/A N/A pkgutil __context__ N/A PkgutilTestCase N/A TestCase N/A N/A 
    Test cases for salt.modules.pkgutil
     test_refresh_db N/A N/A self N/A N/A N/A 
        Test if it updates the pkgutil repo database (pkgutil -U).
         N/A mock N/A MagicMock return_value 0 N/A N/A N/A patch dict N/A pkgutil __salt__ N/A cmd.retcode mock N/A N/A N/A N/A self assertTrue N/A N/A pkgutil refresh_db N/A test_upgrade_available N/A N/A self N/A N/A N/A 
        Test if there is an upgrade available for a certain package.
         N/A mock N/A MagicMock return_value A
 B
 SAME N/A N/A N/A patch dict N/A pkgutil __salt__ N/A cmd.run_stdout mock N/A N/A N/A N/A self assertEqual N/A N/A pkgutil upgrade_available CSWpython N/A mock N/A MagicMock side_effect N/A A
 B
 SALT None N/A N/A N/A patch dict N/A pkgutil __salt__ N/A cmd.run_stdout mock N/A N/A N/A N/A self assertEqual N/A N/A pkgutil upgrade_available CSWpython SALT N/A N/A N/A self assertEqual N/A N/A pkgutil upgrade_available CSWpython N/A test_list_upgrades N/A N/A self N/A N/A N/A 
        Test if it list all available package upgrades on this system.
         N/A mock_run N/A MagicMock return_value A	 B	 SAME N/A mock_ret N/A MagicMock return_value 0 N/A N/A N/A patch dict N/A pkgutil __salt__ N/A cmd.run_stdout cmd.retcode mock_run mock_ret N/A N/A N/A N/A self assertDictEqual N/A N/A pkgutil list_upgrades N/A A  B N/A test_upgrade N/A N/A self N/A N/A N/A 
        Test if it upgrade all of the packages to the latest available version.
         N/A mock_run N/A MagicMock return_value A	 B	 SAME N/A mock_ret N/A MagicMock return_value 0 N/A mock_pkg N/A MagicMock return_value N/A N/A N/A patch dict N/A pkgutil __salt__ N/A cmd.run_stdout cmd.retcode pkg_resource.stringify pkg_resource.sort_pkglist cmd.run_all cmd.run mock_run mock_ret mock_pkg mock_pkg mock_ret mock_run N/A N/A N/A N/A patch dict N/A pkgutil __context__ N/A pkg.list_pkgs mock_ret N/A N/A N/A N/A self assertDictEqual N/A N/A pkgutil upgrade N/A N/A test_list_pkgs N/A N/A self N/A N/A N/A 
        Test if it list the packages currently installed as a dict.
         N/A mock_run N/A MagicMock return_value A	 B	 SAME N/A mock_ret N/A MagicMock return_value True N/A mock_pkg N/A MagicMock return_value N/A N/A N/A patch dict N/A pkgutil __salt__ N/A cmd.run_stdout cmd.retcode pkg_resource.stringify pkg_resource.sort_pkglist cmd.run mock_run mock_ret mock_pkg mock_pkg mock_run N/A N/A N/A N/A patch dict N/A pkgutil __context__ N/A pkg.list_pkgs mock_ret N/A N/A N/A N/A self assertDictEqual N/A N/A pkgutil list_pkgs versions_as_list True removed True N/A N/A N/A N/A self assertDictEqual N/A N/A pkgutil list_pkgs N/A N/A N/A N/A patch dict N/A pkgutil __context__ N/A pkg.list_pkgs True N/A N/A N/A N/A self assertTrue N/A N/A pkgutil list_pkgs versions_as_list True N/A mock_pkg N/A MagicMock return_value True N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.stringify mock_pkg N/A N/A N/A N/A self assertTrue N/A N/A pkgutil list_pkgs N/A test_version N/A N/A self N/A N/A N/A 
        Test if it returns a version if the package is installed.
         N/A mock_ret N/A MagicMock return_value True N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.version mock_ret N/A N/A N/A N/A self assertTrue N/A N/A pkgutil version CSWpython N/A test_latest_version N/A N/A self N/A N/A N/A 
        Test if it return the latest version of the named package
        available for upgrade or installation.
         N/A N/A N/A self assertEqual N/A N/A pkgutil latest_version N/A mock_run_all N/A MagicMock return_value A	 B	 SAME N/A mock_run N/A MagicMock return_value N/A stdout N/A mock_ret N/A MagicMock return_value True N/A mock_pkg N/A MagicMock return_value N/A N/A N/A patch dict N/A pkgutil __salt__ N/A cmd.retcode pkg_resource.stringify pkg_resource.sort_pkglist cmd.run_all cmd.run mock_ret mock_pkg mock_pkg mock_run mock_run_all N/A N/A N/A N/A self assertEqual N/A N/A pkgutil latest_version CSWpython N/A N/A N/A self assertDictEqual N/A N/A pkgutil latest_version CSWpython Python N/A Python CSWpython N/A test_install N/A N/A self N/A N/A N/A 
        Test if it install packages using the pkgutil tool.
         N/A mock_pkg N/A MagicMock side_effect MinionError N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.parse_targets mock_pkg N/A N/A N/A N/A self assertRaises CommandExecutionError N/A pkgutil install N/A mock_ret N/A MagicMock return_value True N/A mock_pkg N/A MagicMock return_value N/A N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.parse_targets mock_pkg N/A N/A N/A N/A patch dict N/A pkgutil __context__ N/A pkg.list_pkgs mock_ret N/A N/A N/A N/A self assertDictEqual N/A N/A pkgutil install N/A N/A mock_run N/A MagicMock return_value A	 B	 SAME N/A mock_run_all N/A MagicMock return_value N/A stdout N/A mock_pkg N/A MagicMock return_value N/A N/A bar 1.2.3 N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.parse_targets pkg_resource.stringify pkg_resource.sort_pkglist cmd.run_all cmd.run mock_pkg mock_pkg mock_pkg mock_run_all mock_run N/A N/A N/A N/A patch dict N/A pkgutil __context__ N/A pkg.list_pkgs mock_ret N/A N/A N/A N/A self assertDictEqual N/A N/A pkgutil install pkgs ["foo", {"bar": "1.2.3"}] N/A N/A test_remove N/A N/A self N/A N/A N/A 
        Test if it remove a package and all its dependencies
        which are not in use by other packages.
         N/A mock_pkg N/A MagicMock side_effect MinionError N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.parse_targets mock_pkg N/A N/A N/A N/A self assertRaises CommandExecutionError N/A pkgutil remove N/A mock_ret N/A MagicMock return_value True N/A mock_run N/A MagicMock return_value A	 B	 SAME N/A mock_run_all N/A MagicMock return_value N/A stdout N/A mock_pkg N/A MagicMock return_value N/A N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.parse_targets pkg_resource.stringify pkg_resource.sort_pkglist cmd.run_all cmd.run mock_pkg mock_pkg mock_pkg mock_run_all mock_run N/A N/A N/A N/A patch dict N/A pkgutil __context__ N/A pkg.list_pkgs mock_ret N/A N/A N/A N/A self assertDictEqual N/A N/A pkgutil remove N/A N/A mock_pkg N/A MagicMock return_value N/A N/A bar 1.2.3 N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.parse_targets pkg_resource.stringify pkg_resource.sort_pkglist cmd.run_all cmd.run mock_pkg mock_pkg mock_pkg mock_run_all mock_run N/A N/A N/A N/A patch dict N/A pkgutil __context__ N/A pkg.list_pkgs mock_ret N/A N/A N/A N/A patch object pkgutil list_pkgs return_value N/A bar 1.2.3 N/A N/A N/A N/A self assertDictEqual N/A N/A pkgutil remove pkgs ["foo", "bar"] N/A N/A test_purge N/A N/A self N/A N/A N/A 
        Test if it package purges are not supported,
        this function is identical to ``remove()``.
         N/A mock_pkg N/A MagicMock side_effect MinionError N/A N/A N/A patch dict N/A pkgutil __salt__ N/A pkg_resource.parse_targets mock_pkg N/A N/A N/A N/A self assertRaises CommandExecutionError N/A pkgutil purge N/A N/A N/A skipIf NO_MOCK NO_MOCK_REASON N/A N/A __name__ __main__ N/A integration run_tests N/A N/A run_tests PkgutilTestCase needs_daemon False