def test_Delete__subdir(self): target = os.path.join(self.tempdir, "dir1") os.mkdir(target) task_config = TaskConfig({"options": {"path": "dir1"}}) task = util.Delete(self.project_config, task_config, self.org_config) task() self.assertFalse(os.path.exists(target))
def test_Delete__single_file(self): file_path = os.path.join(self.tempdir, "file") with open(file_path, "w"): pass task_config = TaskConfig({"options": {"path": "file"}}) task = util.Delete(self.project_config, task_config, self.org_config) task() self.assertFalse(os.path.exists(file_path))
def test_Delete__glob(self): target = os.path.join(self.tempdir, "dir1") os.mkdir(target) file_path = os.path.join(target, "file") with open(file_path, "w"): pass task_config = TaskConfig({"options": {"path": ["*"], "chdir": target}}) task = util.Delete(self.project_config, task_config, self.org_config) task() self.assertFalse(os.path.exists(file_path))
def test_Delete__no_match(self): task_config = TaskConfig({"options": {"path": "bogus"}}) task = util.Delete(self.project_config, task_config, self.org_config) task()