|  | @@ -66,6 +66,7 @@ def test_remove_database_dumps_removes_dump_for_each_database():
 | 
	
		
			
				|  |  |          'databases', 'bar', None
 | 
	
		
			
				|  |  |      ).and_return('databases/localhost/bar')
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    flexmock(module.os.path).should_receive('isdir').and_return(False)
 | 
	
		
			
				|  |  |      flexmock(module.os).should_receive('remove').with_args('databases/localhost/foo').once()
 | 
	
		
			
				|  |  |      flexmock(module.os).should_receive('remove').with_args('databases/localhost/bar').once()
 | 
	
		
			
				|  |  |      flexmock(module.os).should_receive('listdir').with_args('databases/localhost').and_return(
 | 
	
	
		
			
				|  | @@ -77,6 +78,21 @@ def test_remove_database_dumps_removes_dump_for_each_database():
 | 
	
		
			
				|  |  |      module.remove_database_dumps('databases', databases, 'SuperDB', 'test.yaml', dry_run=False)
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +def test_remove_database_dumps_removes_dump_in_directory_format():
 | 
	
		
			
				|  |  | +    databases = [{'name': 'foo'}]
 | 
	
		
			
				|  |  | +    flexmock(module).should_receive('make_database_dump_filename').with_args(
 | 
	
		
			
				|  |  | +        'databases', 'foo', None
 | 
	
		
			
				|  |  | +    ).and_return('databases/localhost/foo')
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    flexmock(module.os.path).should_receive('isdir').and_return(True)
 | 
	
		
			
				|  |  | +    flexmock(module.os).should_receive('remove').never()
 | 
	
		
			
				|  |  | +    flexmock(module.shutil).should_receive('rmtree').with_args('databases/localhost/foo').once()
 | 
	
		
			
				|  |  | +    flexmock(module.os).should_receive('listdir').with_args('databases/localhost').and_return([])
 | 
	
		
			
				|  |  | +    flexmock(module.os).should_receive('rmdir').with_args('databases/localhost').once()
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    module.remove_database_dumps('databases', databases, 'SuperDB', 'test.yaml', dry_run=False)
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  def test_remove_database_dumps_with_dry_run_skips_removal():
 | 
	
		
			
				|  |  |      databases = [{'name': 'foo'}, {'name': 'bar'}]
 | 
	
		
			
				|  |  |      flexmock(module.os).should_receive('rmdir').never()
 |