Mercurial > hg
diff tests/test-bundle2-exchange.t @ 37748:affcecf20c15
tests: update inline extensions in test-bundle2-exchange.t to py3
The test doesn't pass for what superficially look like good
reasons. We'll need to come back to it later.
# skip-blame because it's b prefixes and a couple of b'N' instead of str(N)
Differential Revision: https://phab.mercurial-scm.org/D3357
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 13 Apr 2018 23:50:17 -0400 |
parents | 0a9751ece252 |
children | eb9835014d20 |
line wrap: on
line diff
--- a/tests/test-bundle2-exchange.t Fri Apr 13 23:11:46 2018 -0400 +++ b/tests/test-bundle2-exchange.t Fri Apr 13 23:50:17 2018 -0400 @@ -472,28 +472,28 @@ > > configtable = {} > configitem = registrar.configitem(configtable) - > configitem('failpush', 'reason', + > configitem(b'failpush', b'reason', > default=None, > ) > > def _pushbundle2failpart(pushop, bundler): - > reason = pushop.ui.config('failpush', 'reason') + > reason = pushop.ui.config(b'failpush', b'reason') > part = None - > if reason == 'abort': - > bundler.newpart('test:abort') - > if reason == 'unknown': - > bundler.newpart('test:unknown') - > if reason == 'race': + > if reason == b'abort': + > bundler.newpart(b'test:abort') + > if reason == b'unknown': + > bundler.newpart(b'test:unknown') + > if reason == b'race': > # 20 Bytes of crap - > bundler.newpart('check:heads', data='01234567890123456789') + > bundler.newpart(b'check:heads', data=b'01234567890123456789') > - > @bundle2.parthandler("test:abort") + > @bundle2.parthandler(b"test:abort") > def handleabort(op, part): - > raise error.Abort('Abandon ship!', hint="don't panic") + > raise error.Abort(b'Abandon ship!', hint=b"don't panic") > > def uisetup(ui): - > exchange.b2partsgenmapping['failpart'] = _pushbundle2failpart - > exchange.b2partsgenorder.insert(0, 'failpart') + > exchange.b2partsgenmapping[b'failpart'] = _pushbundle2failpart + > exchange.b2partsgenorder.insert(0, b'failpart') > > EOF @@ -782,16 +782,16 @@ > from mercurial import pushkey > from mercurial import node > from mercurial import error - > @exchange.b2partsgenerator('failingpuskey') + > @exchange.b2partsgenerator(b'failingpuskey') > def addfailingpushey(pushop, bundler): > enc = pushkey.encode - > part = bundler.newpart('pushkey') - > part.addparam('namespace', enc('phases')) - > part.addparam('key', enc('cd010b8cd998f3981a5a8115f94f8da4ab506089')) - > part.addparam('old', enc(str(0))) # successful update - > part.addparam('new', enc(str(0))) + > part = bundler.newpart(b'pushkey') + > part.addparam(b'namespace', enc(b'phases')) + > part.addparam(b'key', enc(b'cd010b8cd998f3981a5a8115f94f8da4ab506089')) + > part.addparam(b'old', enc(b'0')) # successful update + > part.addparam(b'new', enc(b'0')) > def fail(pushop, exc): - > raise error.Abort('Correct phase push failed (because hooks)') + > raise error.Abort(b'Correct phase push failed (because hooks)') > pushop.pkfailcb[part.id] = fail > EOF $ cat >> $HGRCPATH << EOF @@ -858,16 +858,16 @@ > from mercurial import pushkey > from mercurial import node > from mercurial import error - > @exchange.b2partsgenerator('failingpuskey') + > @exchange.b2partsgenerator(b'failingpuskey') > def addfailingpushey(pushop, bundler): > enc = pushkey.encode - > part = bundler.newpart('pushkey') - > part.addparam('namespace', enc('phases')) - > part.addparam('key', enc('cd010b8cd998f3981a5a8115f94f8da4ab506089')) - > part.addparam('old', enc(str(4))) # will fail - > part.addparam('new', enc(str(3))) + > part = bundler.newpart(b'pushkey') + > part.addparam(b'namespace', enc(b'phases')) + > part.addparam(b'key', enc(b'cd010b8cd998f3981a5a8115f94f8da4ab506089')) + > part.addparam(b'old', enc(b'4')) # will fail + > part.addparam(b'new', enc(b'3')) > def fail(pushop, exc): - > raise error.Abort('Clown phase push failed') + > raise error.Abort(b'Clown phase push failed') > pushop.pkfailcb[part.id] = fail > EOF $ cat >> $HGRCPATH << EOF