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

Method test

test/IECoreScene/Camera.py:51–74  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

49 self.assertAlmostEqual( box.max().y, y2 )
50
51 def test( self ) :
52
53 c = IECoreScene.Camera()
54 self.assertEqual( c.parameters(), IECore.CompoundData() )
55
56 cc = c.copy()
57 self.assertEqual( cc.parameters(), IECore.CompoundData() )
58 self.assertEqual( cc, c )
59
60 IECore.Writer.create( cc, os.path.join( "test", "IECore", "data", "camera.cob" ) ).write()
61 ccc = IECore.Reader.create( os.path.join( "test", "IECore", "data", "camera.cob" ) ).read()
62
63 self.assertEqual( c, ccc )
64
65 c.setFocalLength( 5 )
66 self.assertEqual( c.getFocalLength(), 5 )
67
68 # test copying and saving with some parameters
69 cc = c.copy()
70 self.assertEqual( cc, c )
71
72 IECore.Writer.create( cc, os.path.join( "test", "IECore", "data", "camera.cob" ) ).write()
73 ccc = IECore.Reader.create( os.path.join( "test", "IECore", "data", "camera.cob" ) ).read()
74 self.assertEqual( ccc, c )
75
76 def testCameraParameters( self ) :
77

Callers

nothing calls this directly

Calls 8

CompoundDataMethod · 0.80
joinMethod · 0.80
CameraMethod · 0.45
parametersMethod · 0.45
copyMethod · 0.45
writeMethod · 0.45
createMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected