def test_pardon_implict_project(self): os.chdir(path.join(self.root, self.project)) # exile is run within a project dir cmdl = [self.exile_script, 'exile', '-r', self.root, self.cand] rc = subprocess.call(cmdl) self.assertEqual(rc, 0) self.assertTrue(exile_utils.check(self.root)[0]) fs = exile.folders(self.root, self.project) self.assertTrue(self.cand in fs) self.assertTrue(self.cand not in exile.candidates(self.root, self.project)) cmdl = [self.exile_script, 'pardon', '-r', self.root, self.cand] rc = subprocess.call(cmdl) self.assertEqual(rc, 0) ck = exile_utils.check(self.root) self.assertEqual(ck, (True, ''), ck[1]) fs = exile.folders(self.root, self.project) self.assertTrue(self.cand not in fs) self.assertTrue(self.cand in exile.candidates(self.root, self.project))
def test_pardon_implict_root(self): os.environ['EXILER_ROOT'] = self.root cmdl = [self.exile_script, 'exile', '-p', self.project, self.cand] rc = subprocess.call(cmdl) self.assertEqual(rc, 0) self.assertTrue(exile_utils.check(self.root)[0]) fs = exile.folders(self.root, self.project) self.assertTrue(self.cand in fs) self.assertTrue(self.cand not in exile.candidates(self.root, self.project)) cmdl = [self.exile_script, 'pardon', '-p', self.project, self.cand] rc = subprocess.call(cmdl) self.assertEqual(rc, 0) ck = exile_utils.check(self.root) self.assertEqual(ck, (True, ''), ck[1]) fs = exile.folders(self.root, self.project) self.assertTrue(self.cand not in fs) self.assertTrue(self.cand in exile.candidates(self.root, self.project))
def test_exile(self): cmdl = [self.exile_script, 'exile', '-r', self.root, '-p', self.project, self.cand] rc = subprocess.call(cmdl) self.assertEqual(rc, 0) fs = exile.folders(self.root, self.project) self.assertTrue(self.cand in fs) self.assertTrue(self.cand not in exile.candidates(self.root, self.project)) self.assertTrue(exile_utils.check(self.root)[0])
def test_pardon(self): cmdl = [self.exile_script, 'exile', '-r', self.root, '-p', self.project, self.cand] rc = subprocess.call(cmdl) self.assertEqual(rc, 0) # verify the candidate subdir is now exiled: self.assertTrue(exile_utils.check(self.root)[0]) fs = exile.folders(self.root, self.project) self.assertTrue(self.cand in fs) self.assertTrue(self.cand not in exile.candidates(self.root, self.project)) cmdl = [self.exile_script, 'pardon', '-r', self.root, '-p', self.project, self.cand] rc = subprocess.call(cmdl) # undo exile self.assertEqual(rc, 0) # subprocess.call(['tree', exile.dot_exile(self.root)]) ck = exile_utils.check(self.root) self.assertEqual(ck, (True, ''), ck[1]) fs = exile.folders(self.root, self.project) self.assertTrue(self.cand not in fs) self.assertTrue(self.cand in exile.candidates(self.root, self.project))