unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Floris Bruynooghe <flub@devork.be>,
	David Bremner <david@tethera.net>,
	notmuch@notmuchmail.org
Subject: [PATCH v2 1/2] test: known broken test for list(db.config) in python-cffi bindings
Date: Wed, 16 Feb 2022 22:08:34 -0400	[thread overview]
Message-ID: <20220217020835.180940-2-david@tethera.net> (raw)
In-Reply-To: <20220217020835.180940-1-david@tethera.net>

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

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

diff --git a/test/T055-path-config.sh b/test/T055-path-config.sh
index 1df240dd..71823039 100755
--- a/test/T055-path-config.sh
+++ b/test/T055-path-config.sh
@@ -293,6 +293,27 @@ 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.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

  reply	other threads:[~2022-02-17  2:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 13:04 use new config API in python-cffi config iterator David Bremner
2022-02-11 13:04 ` [PATCH 1/2] test: known broken test for list(db.config) in python-cffi bindings David Bremner
2022-02-11 13:04 ` [PATCH 2/2] python-cffi: use config_pairs API in ConfigIterator David Bremner
2022-02-16 20:52   ` Floris Bruynooghe
2022-02-17  2:08     ` David Bremner
2022-02-17  2:08       ` David Bremner [this message]
2022-02-17  2:08       ` [PATCH v2 2/2] python-cffi: use config_pairs API in ConfigIterator David Bremner
2022-02-17 21:30         ` Floris Bruynooghe
2022-02-18  0:27           ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220217020835.180940-2-david@tethera.net \
    --to=david@tethera.net \
    --cc=flub@devork.be \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).