diff tests/test-push-http.t @ 14011:b69471bdb678

tests: add script to disable a selected wire protocol capability This can be used to test that the client and server both fall back to the previous wire protocol when the capability is not supported. It is currently used by test-push-http.t and I plan to use it for the HTTP long argument support tests.
author Steven Brown <StevenGBrown@gmail.com>
date Mon, 25 Apr 2011 18:00:30 +0800
parents 3c2f9f611ef6
children ce99d887585f
line wrap: on
line diff
--- a/tests/test-push-http.t	Mon Apr 25 14:03:12 2011 +0200
+++ b/tests/test-push-http.t	Mon Apr 25 18:00:30 2011 +0800
@@ -68,17 +68,8 @@
 
 expect success, server lacks the unbundlehash capability
 
-  $ cat > unbundlehash-off.py << EOF
-  > from mercurial import extensions, repo
-  > def extsetup():
-  >     extensions.wrapfunction(repo.repository, 'capable', wrapper)
-  > def wrapper(orig, self, name, *args, **kwargs):
-  >     if name == 'unbundlehash':
-  >         return False
-  >     return orig(self, name, *args, **kwargs)
-  > EOF
-  $ echo '[extensions]' >> .hg/hgrc
-  $ echo "unbundlehash-off = `pwd`/unbundlehash-off.py" >> .hg/hgrc
+  $ CAP=unbundlehash
+  $ . "$TESTDIR/notcapable"
   $ req
   pushing to http://localhost:$HGPORT/
   searching for changes