From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 3C8796DE207E for ; Thu, 9 Mar 2017 05:34:14 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.135 X-Spam-Level: X-Spam-Status: No, score=-0.135 tagged_above=-999 required=5 tests=[AWL=-0.115, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PdYkz35eys5Z for ; Thu, 9 Mar 2017 05:34:13 -0800 (PST) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by arlo.cworth.org (Postfix) with ESMTPS id 1C8616DE207C for ; Thu, 9 Mar 2017 05:34:13 -0800 (PST) Received: by mail-lf0-f44.google.com with SMTP id y193so28137457lfd.3 for ; Thu, 09 Mar 2017 05:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaute-vetsj-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rmHMXycVx8aAUJISx1xS5Y61WMPTdPdieLbzuImm8OI=; b=EYWNwF0nNwFn74KYI9v1UrdaC8xzl/j+z8OHMtUgYk4ukZhf/vPQ7MXfq9rCirLSiJ QshirnKgpsBYghFpPj40254Jr/92kguE/AtY+mFIqYzBaoccA0mxd1vM7bbG2rYLB70x tKVd2ynQjUJK8TCcCinipioZ7YilECaZrn6nFKLOxphtWCwPlHumEALmp1BcPzpzBnYV Njiw331qCqjl6GEaXKYtwLtxnSVhY6KDZT2anSe61Aho1oix1x2hrrAcl6nzuri78MGr EoaR+8g6arZs2bW3bp5yxi5I6Vl1P2i3sCFiFM07Siqf03szgPhofooTUxLfGcKI3/SC rUIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rmHMXycVx8aAUJISx1xS5Y61WMPTdPdieLbzuImm8OI=; b=WrLK0o3s3XwClYz9t/gGBWpk3FermlzR+mTZqmLGtuU4imCpRLcoiTdmLnMGtLNJRg IHv2lGsa2XfivF3Za/XeWbkSJYveIMEXfXdRJG7S7APNK850cySPbIGS+rPFW3ozNR8a kTne/sehk0hWaEcFiYIe6xo3LPjabhVvJsjepLH817IB1peOaoN16iVfJ3M0YvqBMi4A 0dCRwYopls7axha5C9B++nnIP/vtPd7sHKfUI+8odC+VDdG5ubwjnpQzlQWfABWM7hRM Gh+YnCd7HZyNT7AwL2I6p9rIExTlWujCrP2jeC1uqF1nHJ845L/q+Pz6xFfbXH7rmEmF yLaQ== X-Gm-Message-State: AMke39kPNJPPJLVEh7AFtB71tgL7usf6UUFSDJpv4JX/X63zR3OqEr2V3WFQzX2yRn9PAg== X-Received: by 10.46.84.22 with SMTP id i22mr3957530ljb.132.1489066450363; Thu, 09 Mar 2017 05:34:10 -0800 (PST) Received: from localhost ([128.39.46.106]) by smtp.gmail.com with ESMTPSA id j78sm1226243lfe.29.2017.03.09.05.34.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Mar 2017 05:34:09 -0800 (PST) From: Gaute Hope To: notmuch@notmuchmail.org Subject: [PATCH] bindings/python: test python Database.get_revision () Date: Thu, 9 Mar 2017 14:32:28 +0100 Message-Id: <20170309133228.29887-1-eg@gaute.vetsj.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170306163734.17350-1-eg@gaute.vetsj.com> References: <20170306163734.17350-1-eg@gaute.vetsj.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Mar 2017 13:34:14 -0000 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