def testReferenceCounting(self):
     '''Test reference counting when retrieving data with PointerHolder.pointer().'''
     a = (1, 2, 3)
     refcnt = sys.getrefcount(a)
     ph = PointerHolder(a)
     ptr = ph.pointer()
     self.assertEqual(sys.getrefcount(a), refcnt + 1)
Ejemplo n.º 2
0
 def testReferenceCounting(self):
     '''Test reference counting when retrieving data with PointerHolder.pointer().'''
     a = (1, 2, 3)
     refcnt = sys.getrefcount(a)
     ph = PointerHolder(a)
     ptr = ph.pointer()
     self.assertEqual(sys.getrefcount(a), refcnt + 1)
 def testStoringAndRetrievingPointer(self):
     ph = PointerHolder('Hello')
     self.assertEqual(ph.pointer(), 'Hello')
     a = (1, 2, 3)
     ph = PointerHolder(a)
     self.assertEqual(ph.pointer(), a)
Ejemplo n.º 4
0
 def testStoringAndRetrievingPointer(self):
     ph = PointerHolder('Hello')
     self.assertEqual(ph.pointer(), 'Hello')
     a = (1, 2, 3)
     ph = PointerHolder(a)
     self.assertEqual(ph.pointer(), a)