def METHOD_NAME(self):
    """
    Test pkg.version for mac. Installs a package and then checks we can get
    a version for the installed package.
    """
    try:
        self.run_function("pkg.install", [ADD_PKG])
        pkg_list = self.run_function("pkg.list_pkgs")
        version = self.run_function("pkg.version", [ADD_PKG])
        try:
            self.assertTrue(
                version,
                msg="version: {} is empty, or other issue is present".format(
                    version
                ),
            )
            self.assertIn(
                ADD_PKG,
                pkg_list,
                msg="package: {} is not in the list of installed packages: {}".format(
                    ADD_PKG, pkg_list
                ),
            )
            # make sure the version is accurate and is listed in the pkg_list
            self.assertIn(
                version,
                str(pkg_list[ADD_PKG]),
                msg="The {} version: {} is not listed in the pkg_list: {}".format(
                    ADD_PKG, version, pkg_list[ADD_PKG]
                ),
            )
        except AssertionError:
            self.run_function("pkg.remove", [ADD_PKG])
            raise
    except CommandExecutionError:
        self.run_function("pkg.remove", [ADD_PKG])
        raise