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 DB9666DE0EC5 for ; Mon, 27 May 2019 13:34:34 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.243 X-Spam-Level: X-Spam-Status: No, score=-0.243 tagged_above=-999 required=5 tests=[AWL=-0.042, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] 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 S7VfO0IB1Wb6 for ; Mon, 27 May 2019 13:34:34 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id E46636DE0C51 for ; Mon, 27 May 2019 13:34:33 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1558989272; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=X/t8se3JP5w6VkewCGZaKVisfz/8PWno98w0ukkX0Dc=; b=T3ARXooxKsvPHqWSfYqlH93B6DuIn/FxbbKgvic/jFPzTnalE2CSred2 TVmTpd+b2w7GZZlmcFNqaPzgcP4PDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1558989272; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=X/t8se3JP5w6VkewCGZaKVisfz/8PWno98w0ukkX0Dc=; b=oJ0nChkHu30v4x6nlOwpGtg1YfdwwwYDvccDfTyR8xpYfTYWOqzSx1D8 b2rTolpwML8Wg9Ez6bszNgoiF7hS+SftEkXLrE3o+B6qwy9edNWfEW131Q 5eznUxk+DriB3+5zuKKVn8In1mdmBvVJtpc/X8lp35MhEorqNp4RGKGeCO gjZRQKiQN742tw4jcs8g+RbIcAsJUHK2D/LfPnHqWgTtKKjHvRhqIiR7b1 TPKabPsjJWGkyENMExddUb01MhGCbuHSNdFoURse6gycu0njcgzrjAiOkm KhmeEs+pLJl99D5PHbwaN5md35PR7vqxKz59umvvvDYuER16AGnytg== Received: from fifthhorseman.net (cpe-74-71-53-242.nyc.res.rr.com [74.71.53.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 7757CF99D; Mon, 27 May 2019 16:34:31 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 930DA2024B; Mon, 27 May 2019 16:34:27 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v3 03/17] test: new test framework to compare json parts Date: Mon, 27 May 2019 16:34:27 -0400 Message-Id: <20190527203427.5662-1-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <874l5gkyq4.fsf@tethera.net> References: <874l5gkyq4.fsf@tethera.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Mon, 27 May 2019 20:34:35 -0000 From: Jameson Graef Rollins This makes it easier to write fairly compact, readable tests of json output, without needing to sanitize away parts that we don't care about. Signed-off-by: Daniel Kahn Gillmor --- test/json_check_nodes.py | 113 +++++++++++++++++++++++++++++++++++++++ test/test-lib.sh | 24 +++++++++ 2 files changed, 137 insertions(+) create mode 100755 test/json_check_nodes.py diff --git a/test/json_check_nodes.py b/test/json_check_nodes.py new file mode 100755 index 00000000..a622969a --- /dev/null +++ b/test/json_check_nodes.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python +import re +import sys +import json + + +EXPR_RE = re.compile('(?P