def test_install_simple(self): with mkdtemp() as d: main([DUMMY_EGG, "--prefix={0}".format(d)]) self.assertTrue(os.path.basename(DUMMY_EGG) in list(get_installed(d))) main(["-r", DUMMY_EGG, "--prefix={0}".format(d)]) self.assertFalse(os.path.basename(DUMMY_EGG) in list(get_installed(d)))
def test_install_simple(self): with mkdtemp() as d: main([DUMMY_EGG, "--prefix={0}".format(d)]) self.assertTrue( os.path.basename(DUMMY_EGG) in list(get_installed(d))) main(["-r", DUMMY_EGG, "--prefix={0}".format(d)]) self.assertFalse( os.path.basename(DUMMY_EGG) in list(get_installed(d)))
def test_get_installed(self): r_installed_eggs = sorted([ os.path.basename(DUMMY_EGG), os.path.basename(DUMMY_EGG_WITH_ENTRY_POINTS), ]) with mkdtemp() as d: egginst = EggInst(DUMMY_EGG, d) egginst.install() egginst = EggInst(DUMMY_EGG_WITH_ENTRY_POINTS, d) egginst.install() installed_eggs = list(get_installed(d)) self.assertEqual(installed_eggs, r_installed_eggs)
def repair(prefix, dry_run): """ Repair every Enthought egg installed in the given prefix Parameters ---------- prefix: str The prefix to repair dry_run: bool If True, the egg-info directory is not modified """ for egg in get_installed(prefix): fixer = EggInfoDirFixer(egg, prefix, dry_run=dry_run) if fixer.needs_repair(): fixer.repair()