]> git.cworth.org Git - notmuch/blobdiff - test/T055-path-config.sh
test: define test_private_C
[notmuch] / test / T055-path-config.sh
index d6494b92afa36f061515353cd82abcd1cb0990c4..4897c8142ac73ea47023744cafcfd966985f1a98 100755 (executable)
@@ -277,7 +277,7 @@ EOF
 built_with.compact=something
 built_with.field_processor=something
 built_with.retry_lock=something
-built_with.sexpr_query=something
+built_with.sexp_queries=something
 database.autocommit=8000
 database.backup_dir
 database.hook_dir
@@ -293,6 +293,26 @@ user.primary_email=test_suite@notmuchmail.org
 EOF
    test_expect_equal_file EXPECTED OUTPUT
 
+   test_begin_subtest "Config list from python ($config)"
+   test_python <<EOF > OUTPUT
+from notmuch2 import Database
+db=Database(config=Database.CONFIG.SEARCH)
+for key in list(db.config):
+    print(key)
+EOF
+   cat <<EOF > EXPECTED
+database.autocommit
+database.backup_dir
+database.hook_dir
+database.mail_root
+database.path
+maildir.synchronize_flags
+new.tags
+user.name
+user.other_email
+user.primary_email
+EOF
+   test_expect_equal_file EXPECTED OUTPUT
    case $config in
        XDG*)
           test_begin_subtest "Set shadowed config value in database ($config)"
@@ -309,17 +329,23 @@ EOF
           ;&
        split)
           test_begin_subtest "'to' header does not crash (python-cffi) ($config)"
-          test_subtest_known_broken
           echo 'notmuch@notmuchmail.org' > EXPECTED
           test_python <<EOF
-import notmuch2
-db=notmuch2.Database()
+from notmuch2 import Database
+db=Database(config=Database.CONFIG.SEARCH)
 m=db.find('20091117232137.GA7669@griffis1.net')
 to=m.header('To')
 print(to)
 EOF
           test_expect_equal_file EXPECTED OUTPUT
-          ;& # fall through
+          ;;
+       *)
+          backup_database
+          test_begin_subtest ".notmuch without xapian/ handled gracefully ($config)"
+          rm -r $XAPIAN_PATH
+          test_expect_success "notmuch new"
+          restore_database
+          ;;
    esac
 
    case $config in