Patchwork [07,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 <15aa75b64e1dff38fcce.1510571097@FB>
Download mbox | patch
Permalink /patch/25507/
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 15aa75b64e1dff38fcce4a8f283daf0ce37a1261
# Parent  a7d1303d69b73deac107d78ed37506f662ec661b
# EXP-Topic better-substitute
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 15aa75b64e1d
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$'
+    ),
+]