def test_upgrade(self):
        mock_run = MagicMock(return_value='A\t B\t SAME')
        mock_ret = MagicMock(return_value=0)
        mock_pkg = MagicMock(return_value='')
        with patch.dict(pkgutil.__salt__,
                        {'cmd.run_stdout': mock_run,
                         'cmd.retcode': mock_ret,
                         'pkg_resource.stringify': mock_pkg,
                         'pkg_resource.sort_pkglist': mock_pkg,
                         'cmd.run_all': mock_ret, 'cmd.run': mock_run}):
            with patch.dict(pkgutil.__context__, {'pkg.list_pkgs': mock_ret}):
                self.assertDictEqual(pkgutil.upgrade(), {})

    # 'list_pkgs' function tests: 1
Pick a feature to attend to
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/pkgutil_test.py/PkgutilTestCase.test_upgrade--crossover with--dataset/ETHPy150Open matt2000/becca/core/spindle.py/Spindle.step