MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testLs

Method testLs

test/IECore/IndexedIO.py:289–307  ·  view source on GitHub ↗

Test FileIndexedIO ls

(self)

Source from the content-addressed store, hash-verified

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"""

Callers

nothing calls this directly

Calls 7

FileIndexedIOMethod · 0.80
joinMethod · 0.80
subdirectoryMethod · 0.80
entryTypeMethod · 0.80
lenFunction · 0.50
entryIdsMethod · 0.45
entryMethod · 0.45

Tested by

no test coverage detected