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

Method testSaveAndLoad

test/IECore/PathMatcherDataTest.py:113–131  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

111 self.assertEqual( d2, d2c )
112
113 def testSaveAndLoad( self ) :
114
115 d = IECore.PathMatcherData(
116 IECore.PathMatcher( [
117 "/a/b/c",
118 "/a/b/d",
119 "/a",
120 "/e/f/g",
121 "/a/e",
122 ] )
123 )
124
125 saveIO = IECore.MemoryIndexedIO( IECore.CharVectorData(), IECore.IndexedIO.OpenMode.Write )
126 d.save( saveIO, "d" )
127
128 loadIO = IECore.MemoryIndexedIO( saveIO.buffer(), IECore.IndexedIO.OpenMode.Read )
129 d2 = IECore.Object.load( loadIO, "d" )
130
131 self.assertEqual( d, d2 )
132
133if __name__ == "__main__":
134 unittest.main()

Callers

nothing calls this directly

Calls 5

saveMethod · 0.95
PathMatcherMethod · 0.80
MemoryIndexedIOMethod · 0.80
bufferMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected