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

Method testSetLimitsCost

test/IECore/LRUCacheTest.py:341–352  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

339 self.assertEqual( calls, [ 10, 10, 10 ] )
340
341 def testSetLimitsCost( self ) :
342
343 c = IECore.LRUCache( lambda key : key, 2 )
344
345 c.set( "a", "a", 1 )
346 self.assertEqual( c.currentCost(), 1 )
347 c.set( "b", "b", 1 )
348 self.assertEqual( c.currentCost(), 2 )
349 c.set( "c", "c", 1 )
350 self.assertEqual( c.currentCost(), 2 )
351 c.set( "d", "d", 1 )
352 self.assertEqual( c.currentCost(), 2 )
353
354if __name__ == "__main__":
355 unittest.main()

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected