def test_get_info_closed(): ctx = ffi.gc( lib.dc_context_new(lib.py_dc_callback, ffi.NULL, ffi.NULL), lib.dc_context_unref, ) info = cutil.from_dc_charpointer(lib.dc_get_info(ctx)) assert 'deltachat_core_version' in info assert 'database_dir' not in info
def test_get_info_open(tmpdir): db_fname = tmpdir.join("test.db") ctx = ffi.gc( lib.dc_context_new(ffi.NULL, db_fname.strpath.encode("ascii"), ffi.NULL), lib.dc_context_unref, ) info = cutil.from_dc_charpointer(lib.dc_get_info(ctx)) assert 'deltachat_core_version' in info assert 'database_dir' in info