Patchwork [3,of,3] tests: add relink extension to hypothesis testing

login
register
mail settings
Submitter Simon Farnsworth
Date Feb. 22, 2016, 7:43 p.m.
Message ID <7555522915fcc32c403f.1456170222@dev1430.lla1.facebook.com>
Download mbox | patch
Permalink /patch/13299/
State Not Applicable
Headers show

Comments

Simon Farnsworth - Feb. 22, 2016, 7:43 p.m.
# HG changeset patch
# User Simon Farnsworth <simonfar@fb.com>
# Date 1456166194 28800
#      Mon Feb 22 10:36:34 2016 -0800
# Branch all
# Node ID 7555522915fcc32c403fbadccc0d02a443b9dd77
# Parent  87c160b301c0c90be408e6a846cb9fcda4a828df
tests: add relink extension to hypothesis testing

Patch

diff --git a/tests/test-verify-repo-operations.py b/tests/test-verify-repo-operations.py
--- a/tests/test-verify-repo-operations.py
+++ b/tests/test-verify-repo-operations.py
@@ -169,7 +169,7 @@ 
         return repo in self.extensions and extension in self.extensions[repo]
 
     @rule(extension=st.sampled_from((
-        'shelve', 'mq'
+        'shelve', 'mq', 'relink'
     )))
     def add_extension(self, extension):
         extensions = self.extensions.setdefault(self.current_repo, set())
@@ -458,6 +458,12 @@ 
         with acceptable_errors("shelved change '%s' not found" % (name,)):
             self.hg("shelve", "--delete", name)
 
+    @rule()
+    @precondition(lambda self: self.has_extension("relink"))
+    def relink(self):
+        with acceptable_errors("repository default-relink not found!"):
+            self.hg("relink")
+
 class WriteOnlyDatabase(ExampleDatabase):
     def __init__(self, underlying):
         super(ExampleDatabase, self).__init__()