1 Return-Path: <bremner@tethera.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id CDF58429E25
\r
6 for <notmuch@notmuchmail.org>; Sun, 4 Dec 2011 17:55:13 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 1obfKB7zj6lW for <notmuch@notmuchmail.org>;
\r
16 Sun, 4 Dec 2011 17:55:13 -0800 (PST)
\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 3AB2D429E21
\r
21 for <notmuch@notmuchmail.org>; Sun, 4 Dec 2011 17:55:13 -0800 (PST)
\r
22 Received: from zancas.localnet
\r
23 (fctnnbsc36w-156034079193.pppoe-dynamic.High-Speed.nb.bellaliant.net
\r
24 [156.34.79.193]) (authenticated bits=0)
\r
25 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pB51t84E026247
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Sun, 4 Dec 2011 21:55:09 -0400
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.77)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1RXNls-0007Qx-FP; Sun, 04 Dec 2011 21:55:08 -0400
\r
31 From: David Bremner <david@tethera.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH] test: add tests for python bindings
\r
34 Date: Sun, 4 Dec 2011 21:54:28 -0400
\r
35 Message-Id: <1323050068-28544-1-git-send-email-david@tethera.net>
\r
36 X-Mailer: git-send-email 1.7.7.3
\r
37 In-Reply-To: <1323027314-8764-1-git-send-email-david@tethera.net>
\r
38 References: <1323027314-8764-1-git-send-email-david@tethera.net>
\r
39 Cc: David Bremner <bremner@debian.org>
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Mon, 05 Dec 2011 01:55:13 -0000
\r
54 From: David Bremner <bremner@debian.org>
\r
56 We start modestly, with a (slightly modified) test case from Kazuo
\r
57 Teramoto. Originally it just made sure the bindings didn't crash; here
\r
58 we check that by comparing the output with that of notmuch search.
\r
60 test/notmuch-test | 1 +
\r
61 test/python | 20 ++++++++++++++++++++
\r
62 2 files changed, 21 insertions(+), 0 deletions(-)
\r
63 create mode 100755 test/python
\r
65 diff --git a/test/notmuch-test b/test/notmuch-test
\r
66 index adfd589..e77f3c5 100755
\r
67 --- a/test/notmuch-test
\r
68 +++ b/test/notmuch-test
\r
69 @@ -46,6 +46,7 @@ TESTS="
\r
71 search-folder-coherence
\r
75 TESTS=${NOTMUCH_TESTS:=$TESTS}
\r
77 diff --git a/test/python b/test/python
\r
78 new file mode 100755
\r
79 index 0000000..28a8aab
\r
83 +#!/usr/bin/env bash
\r
84 +test_description="python bindings"
\r
89 +# This test relies on the output from the python Thread.__str__
\r
90 +# method being byte compatible with that from notmuch search.
\r
92 +test_begin_subtest "compare with notmuch search"
\r
93 +python <<EOF > OUTPUT
\r
95 +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)
\r
96 +q_new = notmuch.Query(db, 'tag:inbox')
\r
97 +for t in q_new.search_threads():
\r
100 +notmuch search tag:inbox > EXPECTED
\r
101 +test_expect_equal_file OUTPUT EXPECTED
\r