]> git.notmuchmail.org Git - notmuch/blobdiff - test/T390-python.sh
test: Add test to unset config items with the python bindings
[notmuch] / test / T390-python.sh
index c6f395e470cffc25bdf710bead1e7875868c9dfd..312d61e8156c1adcc6694505aba6eb5ef21016ad 100755 (executable)
@@ -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