예제 #1
0
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)
예제 #2
0
파일: test_bcolz.py 프로젝트: MoherX/odo
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)
예제 #3
0
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)
예제 #4
0
파일: test_bcolz.py 프로젝트: MoherX/odo
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)
예제 #5
0
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)
예제 #6
0
파일: test_bcolz.py 프로젝트: MoherX/odo
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)