unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] test: known broken test for list(db.config) in python-cffi bindings
@ 2022-02-09  1:11 David Bremner
  2022-02-10 12:25 ` [PATCH v2] " David Bremner
  0 siblings, 1 reply; 2+ messages in thread
From: David Bremner @ 2022-02-09  1:11 UTC (permalink / raw)
  To: notmuch

As of notmuch 0.34.2, the python-cffi bindings make available the
configuration from both a config file and the database
Database.config.  It is therefore confusing that the iterator
operations only work on the configuration information stored in the
database.

The likely fix is to switch to the newer notmuch_config_pairs_t API.

[1]: d7f95724132bf658fd151630185899737e2ed829
---
 test/T055-path-config.sh | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index 1df240dd..1b63bc78 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -293,6 +293,33 @@ user.primary_email=test_suite@notmuchmail.org
 EOF
    test_expect_equal_file EXPECTED OUTPUT
 
+   test_begin_subtest "Config list from python ($config)"
+   test_subtest_known_broken
+   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
+built_with.compact
+built_with.field_processor
+built_with.retry_lock
+built_with.sexp_queries
+database.autocommit
+database.backup_dir
+database.hook_dir
+database.mail_root
+database.path
+maildir.synchronize_flags
+new.ignore
+new.tags
+search.exclude_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)"
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v2] test: known broken test for list(db.config) in python-cffi bindings
  2022-02-09  1:11 [PATCH] test: known broken test for list(db.config) in python-cffi bindings David Bremner
@ 2022-02-10 12:25 ` David Bremner
  0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2022-02-10 12:25 UTC (permalink / raw)
  To: David Bremner, notmuch

As of notmuch 0.34.2, the python-cffi bindings make available the
configuration from both a config file and the database
Database.config.  It is therefore confusing that the iterator
operations only work on the configuration information stored in the
database.

The likely fix is to switch to the newer notmuch_config_pairs_t API.

[1]: d7f95724132bf658fd151630185899737e2ed829
---
 test/T055-path-config.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index 1df240dd..105ee982 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -293,6 +293,30 @@ user.primary_email=test_suite@notmuchmail.org
 EOF
    test_expect_equal_file EXPECTED OUTPUT
 
+   test_begin_subtest "Config list from python ($config)"
+   test_subtest_known_broken
+   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.ignore
+new.tags
+search.exclude_tags
+show.extra_headers
+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)"
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-10 12:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09  1:11 [PATCH] test: known broken test for list(db.config) in python-cffi bindings David Bremner
2022-02-10 12:25 ` [PATCH v2] " David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).