def check_blocks(self, object, num_expected):
        nblocks = talloc.total_blocks(object)
        if object is None:
            nblocks -= self.initial_blocks
        leaked_blocks = (nblocks - num_expected)
        if leaked_blocks != 0:
            print "Leaked %d blocks" % leaked_blocks
check that the number of allocated blocks is correct
dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/tests/dcerpc/testrpc.py/RpcTests.check_blocks