changeset 39648:e37a0fcd82c0

hghave: add a checker for the vcr HTTP record/replay library I'm going to use this to write some tests of the phabricator extension. Differential Revision: https://phab.mercurial-scm.org/D4598
author Augie Fackler <raf@durin42.com>
date Sat, 15 Sep 2018 00:18:16 -0400
parents 543a788eea2d
children d6d094259d9c
files tests/hghave.py
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/hghave.py	Sat Sep 15 00:04:06 2018 -0400
+++ b/tests/hghave.py	Sat Sep 15 00:18:16 2018 -0400
@@ -770,3 +770,13 @@
 @check('repofncache', 'repository has an fncache')
 def has_repofncache():
     return 'fncache' in getrepofeatures()
+
+@check('vcr', 'vcr http mocking library')
+def has_vcr():
+    try:
+        import vcr
+        vcr.VCR
+        return True
+    except (ImportError, AttributeError):
+        pass
+    return False