Test FileIndexedIO ls
(self)
| 287 | self.assertEqual( None, e.subdirectory( "idontexist", IECore.IndexedIO.MissingBehaviour.NullIfMissing ) ) |
| 288 | |
| 289 | def testLs(self): |
| 290 | """Test FileIndexedIO ls""" |
| 291 | |
| 292 | f = IECore.FileIndexedIO(os.path.join( ".", "test", "FileIndexedIO.fio" ), [], IECore.IndexedIO.OpenMode.Write) |
| 293 | |
| 294 | f.subdirectory("sub2", IECore.IndexedIO.MissingBehaviour.CreateIfMissing ) |
| 295 | f = f.subdirectory("sub2") |
| 296 | f.subdirectory("sub2.1", IECore.IndexedIO.MissingBehaviour.CreateIfMissing ) |
| 297 | |
| 298 | # Filter for files |
| 299 | e = f.entryIds( IECore.IndexedIO.EntryType.File ) |
| 300 | self.assertEqual( len(e), 0 ) |
| 301 | |
| 302 | # Filter for directories |
| 303 | e = f.entryIds( IECore.IndexedIO.EntryType.Directory ) |
| 304 | self.assertEqual( len(e), 1 ) |
| 305 | |
| 306 | self.assertEqual( e[0], "sub2.1") |
| 307 | self.assertTrue( f.entry(e[0]).entryType() == IECore.IndexedIO.EntryType.Directory) |
| 308 | |
| 309 | def testRm(self): |
| 310 | """Test FileIndexedIO rm""" |
nothing calls this directly
no test coverage detected