Exemplo n.º 1
0
def test_is_open_actually_open(tmpdir):
    ctx = ffi.gc(
        lib.dc_context_new(lib.py_dc_callback, ffi.NULL, ffi.NULL),
        lib.dc_context_unref,
    )
    db_fname = tmpdir.join("test.db")
    lib.dc_open(ctx, db_fname.strpath.encode("ascii"), ffi.NULL)
    assert lib.dc_is_open(ctx) == 1
Exemplo n.º 2
0
def test_is_open_closed():
    ctx = ffi.gc(
        lib.dc_context_new(lib.py_dc_callback, ffi.NULL, ffi.NULL),
        lib.dc_context_unref,
    )
    assert lib.dc_is_open(ctx) == 0