

def testDownloadCollectionWithFoldersEntries(self):
    'Check we can download RDFValueCollection that also references folders.'
    fd = aff4.FACTORY.Create('aff4:/testcoll', 'RDFValueCollection', token=self.token)
    fd.Add(file_finder.FileFinderResult(stat_entry=rdf_client.StatEntry(aff4path=self.out.Add('testfile5'))))
    expected_outdir.Add(file_finder.FileFinderResult(stat_entry=rdf_client.StatEntry(aff4path=self.out.Add('testdir1'), st_mode=stat.S_IFDIR)))
    fd.Close()
    with utils.TempDirectory() as tmpdir:
        export_utils.DownloadCollection('aff4:/testcoll', tmpdir, overwrite=True, dump_client_info=True, token=self.token, max_threads=2)
        expected_outdir = os.path.join(tmpdir, self.out.Path()[1:])
        self.assertTrue(('testfile5' in os.listdir(expected_outdir)))
        self.assertTrue(('testdir1' in os.listdir(expected_outdir)))

dataset/ETHPy150Open google/grr/grr/lib/export_utils_test.py TestExports.testDownloadCollectionWithFoldersEntries/VarMisuse@59/110 `fd`->`expected_outdir`