def test_resource_existing_ctable(): with tmpfile('.bcolz') as fn: r = into(fn, y) r.flush() r2 = resource(fn) assert eq(r2[:], y) shutil.rmtree(fn)
def tmpbcolz(*args, **kwargs): fn = '.%s.bcolz' % str(uuid.uuid1()) r = resource(fn, *args, **kwargs) try: yield r finally: with ignoring(Exception): r.flush() if os.path.exists(fn): shutil.rmtree(fn)
def test_resource_existing_carray(): with tmpbcolz(dshape='var * int32') as r: append(r, [1, 2, 3]) r.flush() newr = resource(r.rootdir) assert isinstance(newr, carray)