def METHOD_NAME(self):
    """
    Test pkg.list_upgrades: data is in the form {'name1': 'version1',
    'name2': 'version2', ... }
    """
    try:
        upgrades = self.run_function("pkg.list_upgrades")
        try:
            self.assertTrue(isinstance(upgrades, dict))
            if upgrades:
                for name in upgrades:
                    self.assertTrue(isinstance(name, str))
                    self.assertTrue(isinstance(upgrades[name], str))
        except AssertionError:
            self.run_function("pkg.remove", [ADD_PKG])
            raise
    except CommandExecutionError:
        self.run_function("pkg.remove", [ADD_PKG])
        raise