def METHOD_NAME():
    """
    Test upgrading packages.
    """
    ret = {}
    pkg_add_u_stdout = [
        "quirks-2.402 signed on 2018-01-02T16:30:59Z",
        "Read shared items: ok",
    ]
    ret["stdout"] = "\n".join(pkg_add_u_stdout)
    ret["retcode"] = 0
    run_all_mock = MagicMock(return_value=ret)
    with patch.dict(openbsdpkg.__salt__, {"cmd.run_all": run_all_mock}):
        with patch("salt.modules.openbsdpkg.list_pkgs", ListPackages()):
            upgraded = openbsdpkg.upgrade()
            expected = {
                "png": {"new": "1.6.23", "old": ""},
                "ruby": {"new": "2.3.1p1", "old": ""},
            }
            assert upgraded == expected