def test_removeAllScheduledPackagesWithException(): manager = PackageManager(MagicMock()) manager._purgePackage = MagicMock(side_effect=Exception) manager._installed_package_dict = {"beep": {}} manager._to_remove_package_set = {"beep"} manager._removeAllScheduledPackages() assert manager._to_remove_package_set == {"beep"}
def test_removeAllScheduledPackages(): manager = PackageManager(MagicMock()) manager._purgePackage = MagicMock() manager._to_remove_package_set = {"beep"} manager._installed_package_dict = {"beep": {}} manager._removeAllScheduledPackages() assert manager._to_remove_package_set == set()