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

Method testSaveInCurrentDir

test/IECore/ObjectIO.py:204–225  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

202 self.assertTrue( dd["ONE"].isSame( dd["TWO"] ) )
203
204 def testSaveInCurrentDir( self ) :
205
206 o = IECore.CompoundData()
207 one = IECore.IntData( 1 )
208 o["one"] = one
209 o["two"] = IECore.IntData( 2 )
210 o["oneAgain"] = one
211
212 fio = IECore.FileIndexedIO( os.path.join( "test", "o.fio" ), [], IECore.IndexedIO.OpenMode.Write )
213 fio = fio.subdirectory( "a", IECore.IndexedIO.MissingBehaviour.CreateIfMissing )
214 d = fio.path()
215 o.save( fio, "test" )
216 self.assertEqual( fio.path(), d )
217 del fio
218
219 fio = IECore.FileIndexedIO( os.path.join( "test", "o.fio" ), ["a"], IECore.IndexedIO.OpenMode.Read )
220 d = fio.path()
221 self.assertEqual( fio.path(), ["a"] )
222 oo = o.load( fio, "test" )
223 self.assertEqual( fio.path(), d )
224
225 self.assertEqual( o, oo )
226
227 def testSlashesInRepeatedData(self):
228 """Make sure slashes can be used and do not break the symlinks on the Object representation for repeated data."""

Callers

nothing calls this directly

Calls 7

saveMethod · 0.95
loadMethod · 0.95
CompoundDataMethod · 0.80
FileIndexedIOMethod · 0.80
joinMethod · 0.80
subdirectoryMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected