From: Gaute Hope <eg@gaute.vetsj.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] bindings/python: test python Database.get_revision ()
Date: Thu, 9 Mar 2017 14:32:28 +0100 [thread overview]
Message-ID: <20170309133228.29887-1-eg@gaute.vetsj.com> (raw)
In-Reply-To: <20170306163734.17350-1-eg@gaute.vetsj.com>
Here is a test for Database.get_revision (), based on
the first part of T570-revision-tracking.sh.
---
test/T390-python.sh | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/test/T390-python.sh b/test/T390-python.sh
index 4726bc36..b27f0740 100755
--- a/test/T390-python.sh
+++ b/test/T390-python.sh
@@ -38,4 +38,23 @@ print (db.find_message_by_filename("i-dont-exist"))
EOF
test_expect_equal "$(cat OUTPUT)" "None"
+test_begin_subtest "get revision"
+test_python ${MAIL_DIR} <<'EOF'
+import notmuch
+db = notmuch.Database(mode=notmuch.Database.MODE.READ_ONLY)
+(revision, uuid) = db.get_revision()
+print ("%s\t%lu" % (uuid, revision))
+EOF
+notmuch_uuid_sanitize < OUTPUT > CLEAN
+cat <<'EOF' >EXPECTED
+UUID 53
+EOF
+test_expect_equal_file EXPECTED CLEAN
+
+grep '^[0-9a-f]' OUTPUT > INITIAL_OUTPUT
+
+test_begin_subtest "output of count matches test code"
+notmuch count --lastmod '*' | cut -f2-3 > OUTPUT
+test_expect_equal_file INITIAL_OUTPUT OUTPUT
+
test_done
--
2.11.1
next prev parent reply other threads:[~2017-03-09 13:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-06 16:37 [PATCH] bindings/python: add bindings for notmuch_database_get_revision Gaute Hope
2017-03-09 12:32 ` David Bremner
2017-03-09 13:32 ` Gaute Hope [this message]
2017-03-10 11:43 ` [PATCH] bindings/python: test python Database.get_revision () 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=20170309133228.29887-1-eg@gaute.vetsj.com \
--to=eg@gaute.vetsj.com \
--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).