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

Method testRm

test/IECore/IndexedIO.py:309–330  ·  view source on GitHub ↗

Test FileIndexedIO rm

(self)

Source from the content-addressed store, hash-verified

307 self.assertTrue( f.entry(e[0]).entryType() == IECore.IndexedIO.EntryType.Directory)
308
309 def testRm(self):
310 """Test FileIndexedIO rm"""
311
312 f = IECore.FileIndexedIO(os.path.join( ".", "test", "FileIndexedIO.fio" ), [], IECore.IndexedIO.OpenMode.Write)
313 g = f.subdirectory("sub2", IECore.IndexedIO.MissingBehaviour.CreateIfMissing )
314
315 g.subdirectory("sub2.1", IECore.IndexedIO.MissingBehaviour.CreateIfMissing )
316 g.subdirectory("sub2.2", IECore.IndexedIO.MissingBehaviour.CreateIfMissing )
317 g.subdirectory("sub2.3", IECore.IndexedIO.MissingBehaviour.CreateIfMissing )
318
319 e = g.entryIds()
320 self.assertEqual( len(e), 3 )
321 g.remove("sub2.1")
322 e = g.entryIds()
323 self.assertEqual( len(e), 2 )
324 f.subdirectory('sub2').remove("sub2.2")
325 e = g.entryIds()
326 self.assertEqual( len(e), 1 )
327 g.remove("sub2.3")
328 e = g.entryIds()
329 self.assertEqual( len(e), 0 )
330 f.remove("sub2")
331
332 @unittest.skipUnless( os.environ.get("CORTEX_PERFORMANCE_TEST", False), "'CORTEX_PERFORMANCE_TEST' env var not set" )
333 def testRmStress(self) :

Callers

nothing calls this directly

Calls 6

FileIndexedIOMethod · 0.80
joinMethod · 0.80
subdirectoryMethod · 0.80
lenFunction · 0.50
entryIdsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected