hghave: add check for zstd support
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 10 Nov 2016 23:38:41 -0800
changeset 30441 de48d3a0573a
parent 30440 c3944ab1443a
child 30442 41a8106789ca
hghave: add check for zstd support Not all configurations will support zstd. Add a check so we can conditionalize tests.
tests/hghave.py
--- a/tests/hghave.py	Thu Nov 10 23:34:15 2016 -0800
+++ b/tests/hghave.py	Thu Nov 10 23:38:41 2016 -0800
@@ -610,3 +610,12 @@
 @check("unziplinks", "unzip(1) understands and extracts symlinks")
 def unzip_understands_symlinks():
     return matchoutput('unzip --help', br'Info-ZIP')
+
+@check("zstd", "zstd Python module available")
+def has_zstd():
+    try:
+        import mercurial.zstd
+        mercurial.zstd.__version__
+        return True
+    except ImportError:
+        return False