Ejemplo n.º 1
0
	def test_recursive_remove_2 (self):
		"""Recursive removal of file"""		
		## Preparations:
		new_file = 'test_recursive_remove_2'
		new_file = os.path.join (self.testdir, new_file)
		shutil.copyfile ('test/__init__.py', new_file)
		assert (os.path.exists (new_file))
		## Main:
		scratchfile.recursive_remove (new_file)
		assert (not os.path.exists (new_file))		
Ejemplo n.º 2
0
	def test_recursive_remove_1 (self):
		"""Recursive removal of directory"""		
		## Preparations:
		new_dir = 'test_recursive_remove_1'
		rem_dir = os.path.join (self.testdir, new_dir)
		shutil.copytree (self.copydir, rem_dir)
		assert (os.path.exists (rem_dir))
		## Main:
		scratchfile.recursive_remove (rem_dir)
		assert (not os.path.exists (rem_dir))