def test_get_packages(upgradable_only): """Calling get_packages() should return a dictionary of list of packages.""" _reset_apt_caches() packages = cli.get_packages(upgradable_only=upgradable_only) if upgradable_only: assert packages == { 'installed': [], 'upgradable': CLI_UPGRADES, 'uninstalled': [] } else: assert packages == { 'installed': CLI_PACKAGES, 'upgradable': CLI_UPGRADES, 'uninstalled': [] }
def test_get_packages_empty(upgradable_only): """Calling get_packages() with apt cache without pacakges should return a dictionary of empty lists.""" packages = cli.get_packages(upgradable_only=upgradable_only) assert packages == {'installed': [], 'upgradable': [], 'uninstalled': []}