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

Method testReadHeader

test/IECoreImage/ImageReaderTest.py:127–144  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

125 self.assertRaises( Exception, r.channelNames )
126
127 def testReadHeader( self ):
128
129 r = IECoreImage.ImageReader( os.path.join( "test", "IECoreImage", "data", "exr", "manyChannels.exr" ) )
130 h = r.readHeader()
131
132 c = h['channelNames']
133 self.assertEqual( c.staticTypeId(), IECore.StringVectorData.staticTypeId() )
134 self.assertEqual( len( c ), 7 )
135 self.assertTrue( "R" in c )
136 self.assertTrue( "G" in c )
137 self.assertTrue( "B" in c )
138 self.assertTrue( "A" in c )
139 self.assertTrue( "diffuse.red" in c )
140 self.assertTrue( "diffuse.green" in c )
141 self.assertTrue( "diffuse.blue" in c )
142
143 self.assertEqual( h['displayWindow'], IECore.Box2iData( imath.Box2i( imath.V2i(0,0), imath.V2i(255,255) ) ) )
144 self.assertEqual( h['dataWindow'], IECore.Box2iData( imath.Box2i( imath.V2i(0,0), imath.V2i(255,255) ) ) )
145
146 def testDataAndDisplayWindows( self ) :
147

Callers

nothing calls this directly

Calls 5

readHeaderMethod · 0.95
ImageReaderMethod · 0.80
joinMethod · 0.80
staticTypeIdMethod · 0.80
lenFunction · 0.50

Tested by

no test coverage detected