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

Method testDefaultCompressionIsOff

test/IECore/IndexedIO.py:653–671  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

651 IECore.CompoundData( { "compressor" : "lz4", "compressionLevel" : 9, 'version': IECore.IntData( 7 ), "compressionThreadCount" : 32, "decompressionThreadCount" : 1 } ) )
652
653 def testDefaultCompressionIsOff( self ):
654
655 filePath = os.path.join( ".", "test", "FileIndexedIO.fio" )
656
657 f = IECore.IndexedIO.create( filePath, [], IECore.IndexedIO.OpenMode.Write )
658 g = f.subdirectory("sub1", IECore.IndexedIO.MissingBehaviour.CreateIfMissing )
659 g.write( "foo", IECore.IntVectorData( range( 1024 ) ) )
660
661 del g, f
662
663 size = os.path.getsize( filePath )
664
665 self.assertTrue( ( size > (1024 * 4 ) ) )
666 self.assertTrue( ( size < (1024 * 4 + 512 ) ) )
667
668 f = IECore.IndexedIO.create( filePath, [], IECore.IndexedIO.OpenMode.Read )
669
670 self.assertEqual( f.metadata(),
671 IECore.CompoundData( { "compressor" : "lz4", "compressionLevel" : 0, 'version': IECore.IntData( 7 ), "compressionThreadCount" : 1, "decompressionThreadCount" : 1 } ) )
672
673 def setUp( self ):
674

Callers

nothing calls this directly

Calls 6

joinMethod · 0.80
subdirectoryMethod · 0.80
CompoundDataMethod · 0.80
createMethod · 0.45
writeMethod · 0.45
metadataMethod · 0.45

Tested by

no test coverage detected