Patchwork [02,of,11] test-pattern: substitute common compression list

login
register
mail settings
Submitter Boris Feld
Date Nov. 13, 2017, 11:04 a.m.
Message ID <aaaceee35dc84c5a5a7f.1510571092@FB>
Download mbox | patch
Permalink /patch/25502/
State Superseded
Headers show

Comments

Boris Feld - Nov. 13, 2017, 11:04 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1509860498 -3600
#      Sun Nov 05 06:41:38 2017 +0100
# Node ID aaaceee35dc84c5a5a7f3287d2605dd9d5f27688
# Parent  fda6ff97ddead2610694668042f58f892130d982
# EXP-Topic better-substitute
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r aaaceee35dc8
test-pattern: substitute common compression list

The compression list as to be matched with a glob because zstd might not be part
of the option. By using a substitution for these, we won't have to re-glob them
over and over.

Patch

diff --git a/tests/common-pattern.py b/tests/common-pattern.py
new file mode 100644
--- /dev/null
+++ b/tests/common-pattern.py
@@ -0,0 +1,9 @@ 
+# common patterns in test at can safely be replaced
+from __future__ import absolute_import
+
+substitutions = [
+    # list of possible compressions
+    (br'zstd,zlib,none,bzip2',
+     br'$USUAL_COMPRESSIONS$'
+    ),
+]