def testReturnConstPointer(self): '''Point returns a const pointer for itself.''' pt1 = Point(5.0, 2.3) refcount1 = sys.getrefcount(pt1) pt2 = pt1.getSelf() self.assertEqual(pt1, pt2) self.assertEqual(sys.getrefcount(pt1), refcount1 + 1) self.assertEqual(sys.getrefcount(pt1), sys.getrefcount(pt2))