#NEWLINE# def test_allocate( self ) : #NEWLINE# #INDENT# test_pool = set ( [ TestObject ( 33000 ) , TestObject ( 33001 ) ] ) #NEWLINE# a = ia . ItemAllocator ( '/file' , TestObject , test_pool ) #NEWLINE# with mock . patch . object ( ia . ItemAllocator , '_write' ) as write : #NEWLINE# #INDENT# test_object = a . allocate ( 'test' ) #NEWLINE# #UNINDENT# self . assertIn ( 'test' , a . allocations ) #NEWLINE# self . assertIn ( write , a . allocations . values ( ) ) #NEWLINE# self . assertNotIn ( test_object , a . pool ) #NEWLINE# self . assertTrue ( write . called )