From 660f1a5a3373f098f6df8912ef6b62fa2b08d8f0 Mon Sep 17 00:00:00 2001 From: "l-m-h@web.de" Date: Thu, 7 Dec 2017 12:40:51 +0100 Subject: [PATCH] test: Add test to unset config items with the python bindings --- test/T390-python.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/T390-python.sh b/test/T390-python.sh index c6f395e4..312d61e8 100755 --- a/test/T390-python.sh +++ b/test/T390-python.sh @@ -142,4 +142,17 @@ cat <<'EOF' >EXPECTED EOF test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "set_config with no value will unset config entries" +test_python <<'EOF' +import notmuch +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +db.set_config('testkey1', '') +db.set_config('testkey2', '') +db.set_config("zzzafter", '') +db.set_config("aaabefore", '') +v = db.get_configs() +print(list(v) == []) +EOF +test_expect_equal "$(cat OUTPUT)" "True" + test_done