From 70234e5b19e120c7c99437ea0306e94131921684 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Fri, 20 Sep 2019 00:06:36 +0200 Subject: [PATCH] Add a test for fix in #541 A fixed bug should have a test. This is an easy test to write. --- python/tests/test_lowlevel.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/tests/test_lowlevel.py b/python/tests/test_lowlevel.py index f824fb4ef..08e30fbf2 100644 --- a/python/tests/test_lowlevel.py +++ b/python/tests/test_lowlevel.py @@ -59,6 +59,16 @@ def test_wrong_db(tmpdir): assert not lib.dc_open(dc_context, p.strpath.encode("ascii"), ffi.NULL) +def test_empty_blobdir(tmpdir): + # Apparently some client code expects this to be the same as passing NULL. + ctx = ffi.gc( + lib.dc_context_new(lib.py_dc_callback, ffi.NULL, ffi.NULL), + lib.dc_context_unref, + ) + db_fname = tmpdir.join("hello.db") + assert lib.dc_open(ctx, db_fname.strpath.encode("ascii"), b"") + + def test_event_defines(): assert const.DC_EVENT_INFO == 100 assert const.DC_CONTACT_ID_SELF