Mercurial > hg
changeset 41738:c70bdd222dcd
tests: bulk changes to avoid whitespace errors of check-code.py
This is a part of preparation to apply checking with check-code.py on
code fragments embedded in *.t test scripts.
This revision avoids "whitespace" errors of check-code.py below:
- missing whitespace after ","
- missing whitespace in expression
- no whitespace around "=" for named parameters
- wrong whitespace around "="
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 18 Feb 2019 00:27:25 +0900 |
parents | cab32f08c994 |
children | 8ab42ccb68fe |
files | tests/test-bundle2-pushback.t tests/test-convert-cvs.t tests/test-extension.t tests/test-hgweb-no-request-uri.t tests/test-import-context.t tests/test-largefiles-small-disk.t tests/test-mq-missingfiles.t tests/test-mq-qimport.t tests/test-patch-offset.t tests/test-purge.t tests/test-revset.t |
diffstat | 11 files changed, 22 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-bundle2-pushback.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-bundle2-pushback.t Mon Feb 18 00:27:25 2019 +0900 @@ -25,7 +25,8 @@ > b'key': b'new-server-mark', > b'old': b'', > b'new': b'tip'} - > encodedparams = [(k, pushkey.encode(v)) for (k,v) in params.items()] + > encodedparams = [(k, pushkey.encode(v)) + > for (k, v) in params.items()] > op.reply.newpart(b'pushkey', mandatoryparams=encodedparams) > else: > op.reply.newpart(b'output', data=b'pushback not enabled')
--- a/tests/test-convert-cvs.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-convert-cvs.t Mon Feb 18 00:27:25 2019 +0900 @@ -11,11 +11,11 @@ $ echo "[extensions]" >> $HGRCPATH $ echo "convert = " >> $HGRCPATH $ cat > cvshooks.py <<EOF - > def cvslog(ui,repo,hooktype,log): - > ui.write(b'%s hook: %d entries\n' % (hooktype,len(log))) + > def cvslog(ui, repo, hooktype, log): + > ui.write(b'%s hook: %d entries\n' % (hooktype, len(log))) > - > def cvschangesets(ui,repo,hooktype,changesets): - > ui.write(b'%s hook: %d changesets\n' % (hooktype,len(changesets))) + > def cvschangesets(ui, repo, hooktype, changesets): + > ui.write(b'%s hook: %d changesets\n' % (hooktype, len(changesets))) > EOF $ hookpath=`pwd` $ cat <<EOF >> $HGRCPATH
--- a/tests/test-extension.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-extension.t Mon Feb 18 00:27:25 2019 +0900 @@ -640,7 +640,7 @@ Make sure a broken uisetup doesn't globally break hg: $ cat > $TESTTMP/baduisetup.py <<EOF > def uisetup(ui): - > 1/0 + > 1 / 0 > EOF Even though the extension fails during uisetup, hg is still basically usable: @@ -649,7 +649,7 @@ File "*/mercurial/extensions.py", line *, in _runuisetup (glob) uisetup(ui) File "$TESTTMP/baduisetup.py", line 2, in uisetup - 1/0 + 1 / 0 ZeroDivisionError: * by zero (glob) *** failed to set up extension baduisetup: * by zero (glob) Mercurial Distributed SCM (version *) (glob)
--- a/tests/test-hgweb-no-request-uri.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-hgweb-no-request-uri.t Mon Feb 18 00:27:25 2019 +0900 @@ -62,12 +62,12 @@ > output = stringio() > env['PATH_INFO'] = '/' > env['QUERY_STRING'] = 'style=atom' - > process(hgweb.hgweb(b'.', name = b'repo')) + > process(hgweb.hgweb(b'.', name=b'repo')) > > output = stringio() > env['PATH_INFO'] = '/file/tip/' > env['QUERY_STRING'] = 'style=raw' - > process(hgweb.hgweb(b'.', name = b'repo')) + > process(hgweb.hgweb(b'.', name=b'repo')) > > output = stringio() > env['PATH_INFO'] = '/'
--- a/tests/test-import-context.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-import-context.t Mon Feb 18 00:27:25 2019 +0900 @@ -12,9 +12,9 @@ > count = int(pattern[0:-1]) > char = pattern[-1].encode('utf8') + b'\n' > if not lasteol and i == len(patterns) - 1: - > fp.write((char*count)[:-1]) + > fp.write((char * count)[:-1]) > else: - > fp.write(char*count) + > fp.write(char * count) > fp.close() > EOF $ cat > cat.py <<EOF
--- a/tests/test-largefiles-small-disk.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-largefiles-small-disk.t Mon Feb 18 00:27:25 2019 +0900 @@ -9,7 +9,7 @@ > # > # this makes the original largefiles code abort: > _origcopyfileobj = shutil.copyfileobj - > def copyfileobj(fsrc, fdst, length=16*1024): + > def copyfileobj(fsrc, fdst, length=16 * 1024): > # allow journal files (used by transaction) to be written > if b'journal.' in fdst.name: > return _origcopyfileobj(fsrc, fdst, length)
--- a/tests/test-mq-missingfiles.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-mq-missingfiles.t Mon Feb 18 00:27:25 2019 +0900 @@ -15,10 +15,10 @@ > > f = open(path, 'wb') > for i in range(len(args) // 2): - > count, s = args[2*i:2*i+2] + > count, s = args[2 * i:2 * i + 2] > count = int(count) > s = encode(s) - > f.write(s*count) + > f.write(s * count) > f.close() > EOF
--- a/tests/test-mq-qimport.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-mq-qimport.t Mon Feb 18 00:27:25 2019 +0900 @@ -9,11 +9,11 @@ > assert (len(args) % 2) == 0 > > f = open(path, 'wb') - > for i in range(len(args)//2): - > count, s = args[2*i:2*i+2] + > for i in range(len(args) // 2): + > count, s = args[2 * i:2 * i + 2] > count = int(count) > s = encode(s) - > f.write(s*count) + > f.write(s * count) > f.close() > > EOF
--- a/tests/test-patch-offset.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-patch-offset.t Mon Feb 18 00:27:25 2019 +0900 @@ -9,7 +9,7 @@ > for pattern in patterns: > count = int(pattern[0:-1]) > char = pattern[-1].encode('utf8') + b'\n' - > fp.write(char*count) + > fp.write(char * count) > fp.close() > EOF
--- a/tests/test-purge.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-purge.t Mon Feb 18 00:27:25 2019 +0900 @@ -52,7 +52,7 @@ $ "$PYTHON" <<EOF > import os > import stat - > f= 'untracked_file_readonly' + > f = 'untracked_file_readonly' > os.chmod(f, stat.S_IMODE(os.stat(f).st_mode) & ~stat.S_IWRITE) > EOF $ hg purge -p
--- a/tests/test-revset.t Mon Feb 18 00:27:25 2019 +0900 +++ b/tests/test-revset.t Mon Feb 18 00:27:25 2019 +0900 @@ -12,9 +12,9 @@ > """ > if 3 not in subset: > if 2 in subset: - > return baseset([2,2]) + > return baseset([2, 2]) > return baseset() - > return baseset([3,3,2,2]) + > return baseset([3, 3, 2, 2]) > > mercurial.revset.symbols[b'r3232'] = r3232 > EOF