diff --git a/tests/mockblackbox.py b/tests/mockblackbox.py new file mode 100644 --- /dev/null +++ b/tests/mockblackbox.py @@ -0,0 +1,11 @@ +from mercurial import util + +def makedate(): + return 0, 0 +def getuser(): + return 'bob' + +# mock the date and user apis so the output is always the same +def uisetup(ui): + util.makedate = makedate + util.getuser = getuser diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -1,20 +1,8 @@ setup - $ cat > mock.py < from mercurial import util - > - > def makedate(): - > return 0, 0 - > def getuser(): - > return 'bob' - > # mock the date and user apis so the output is always the same - > def uisetup(ui): - > util.makedate = makedate - > util.getuser = getuser - > EOF $ cat >> $HGRCPATH < [extensions] > blackbox= - > mock=`pwd`/mock.py + > mock=$TESTDIR/mockblackbox.py > mq= > EOF $ hg init blackboxtest