[tests] add missing PYTHONPATH changes

Summary:
The built linelog.so cannot be discovered automatically. Change `PYTHONPATH`
to make sure it can be found.

Also fix the issue that the rename change misses some places in the test.

Test Plan: `unset PYTHONPATH` and run the touched files.

Reviewers: #sourcecontrol, ttung, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3771583

Signature: t1:3771583:1472145156:d05a1bf0d5920dfd0131acd1998698f2dddae1f8

Blame Revision: D3763992
This commit is contained in:
Jun Wu 2016-08-25 17:42:23 +01:00
parent 437b663de7
commit 80f57e9dc3
3 changed files with 8 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import sys
# make it runnable directly without run-tests.py
sys.path[0:0] = [os.path.join(os.path.dirname(__file__), '..')]
from hgext3rd import smartfixup
from hgext3rd import absorb
class simplefctx(object):
def __init__(self, content):
@ -46,7 +46,7 @@ def testfilefixup(oldcontents, workingcopy, expectedcontents, fixups=None):
expectedcontents = insertreturns(expectedcontents)
oldcontents = insertreturns(oldcontents)
workingcopy = insertreturns(workingcopy)
state = smartfixup.filefixupstate(map(simplefctx, oldcontents))
state = absorb.filefixupstate(map(simplefctx, oldcontents))
state.diffwith(simplefctx(workingcopy))
if fixups is not None:
assertlistequal(state.fixups, fixups)

View File

@ -1,3 +1,6 @@
$ PYTHONPATH=$TESTDIR/../:$PYTHONPATH
$ export PYTHONPATH
$ extpath=`dirname $TESTDIR`
$ cat >> $HGRCPATH << EOF
> [extensions]

View File

@ -1 +1,4 @@
$ PYTHONPATH=$TESTDIR/../:$PYTHONPATH
$ export PYTHONPATH
$ $PYTHON $TESTDIR/../linelog/pyext/test-random-edits.py