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

Method testFactoryFunction

test/IECoreScene/SceneCacheTest.py:58–69  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

56 self.assertFalse( "scc" in IECoreScene.SceneInterface.supportedExtensions( IECore.IndexedIO.OpenMode.Append ) )
57
58 def testFactoryFunction( self ) :
59 # test Write factory function
60 m = IECoreScene.SceneInterface.create( os.path.join( self.tempDir, "test.scc" ), IECore.IndexedIO.OpenMode.Write )
61 self.assertTrue( isinstance( m, IECoreScene.SceneCache ) )
62 self.assertEqual( m.fileName(), os.path.join( self.tempDir, "test.scc" ) )
63 self.assertRaises( RuntimeError, m.readBound, 0.0 )
64 del m
65 # test Read factory function
66 m = IECoreScene.SceneInterface.create( os.path.join( self.tempDir, "test.scc" ), IECore.IndexedIO.OpenMode.Read )
67 self.assertTrue( isinstance( m, IECoreScene.SceneCache ) )
68 self.assertEqual( m.fileName(), os.path.join( self.tempDir, "test.scc" ) )
69 m.readBound( 0.0 )
70
71 def testAppendRaises( self ) :
72 self.assertRaises( RuntimeError, IECoreScene.SceneCache, os.path.join( self.tempDir, "test.scc" ), IECore.IndexedIO.OpenMode.Append )

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
createMethod · 0.45
fileNameMethod · 0.45
readBoundMethod · 0.45

Tested by

no test coverage detected