bundle2: make error testing more modular stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 21 Apr 2014 15:59:55 -0700
branchstable
changeset 21178 9a813e703172
parent 21177 952af771bc17
child 21179 372f4772f7a0
bundle2: make error testing more modular We have more than Abort to test.
tests/test-bundle2.t
--- a/tests/test-bundle2.t	Mon Apr 21 15:48:52 2014 -0700
+++ b/tests/test-bundle2.t	Mon Apr 21 15:59:55 2014 -0700
@@ -904,8 +904,12 @@
   > 
   > def _pushbundle2failpart(orig, pushop, bundler):
   >     extradata = orig(pushop, bundler)
-  >     part = bundle2.bundlepart('test:abort')
-  >     bundler.addpart(part)
+  >     reason = pushop.ui.config('failpush', 'reason', None)
+  >     part = None
+  >     if reason == 'abort':
+  >         part = bundle2.bundlepart('test:abort')
+  >     if part is not None:
+  >         bundler.addpart(part)
   >     return extradata
   > 
   > @bundle2.parthandler("test:abort")
@@ -938,6 +942,11 @@
 
 Doing the actual push: Abort error
 
+  $ cat << EOF >> $HGRCPATH
+  > [failpush]
+  > reason = abort
+  > EOF
+
   $ hg -R main push other -r e7ec4e813ba6
   pushing to other
   searching for changes