| 115 | self.assertEqual( o, oo ) |
| 116 | |
| 117 | def testOverwrite( self ) : |
| 118 | |
| 119 | iface = IECore.IndexedIO.create( os.path.join( "test", "o.fio" ), [], IECore.IndexedIO.OpenMode.Write ) |
| 120 | |
| 121 | o = IECore.IntData( 1 ) |
| 122 | self.assertEqual( o.value, 1 ) |
| 123 | |
| 124 | o.save( iface, "test" ) |
| 125 | oo = IECore.Object.load( iface, "test" ) |
| 126 | self.assertEqual( o.value, oo.value ); |
| 127 | |
| 128 | # saving over an existing file should |
| 129 | # obliterate it but currently doesn't |
| 130 | o = IECore.StringData( "hello" ) |
| 131 | self.assertEqual( o.value, "hello" ) |
| 132 | o.save( iface, "test" ) |
| 133 | oo = IECore.Object.load( iface, "test" ) |
| 134 | self.assertEqual( o.value, oo.value ); |
| 135 | |
| 136 | self.assertEqual( o, oo ); |
| 137 | |
| 138 | d = IECore.CompoundData() |
| 139 | d["A"] = IECore.IntData( 10 ) |
| 140 | d["B"] = IECore.StringData( "hithere" ) |
| 141 | |
| 142 | d.save( iface, "test2" ) |
| 143 | dd = IECore.Object.load( iface, "test2" ) |
| 144 | self.assertEqual( d, dd ); |
| 145 | |
| 146 | # override CompoundData with less data |
| 147 | d = IECore.CompoundData() |
| 148 | d.save( iface, "test2" ) |
| 149 | dd = IECore.Object.load( iface, "test2" ) |
| 150 | self.assertEqual( d, dd ); |
| 151 | |
| 152 | def testCompoundData( self ) : |
| 153 | |