tests: replace mockmakedate function in test-amend.t
This is a follow up patch for D5554. This replaces mockmakedate function
by `tests/mockmakedate.py`.
Differential Revision: https://phab.mercurial-scm.org/D5577
--- a/tests/test-amend.t Thu Jan 10 20:11:19 2019 +0530
+++ b/tests/test-amend.t Sun Jan 13 17:56:02 2019 +0530
@@ -368,30 +368,11 @@
==========================================
Test update-timestamp config option|
==========================================
- $ cat >> testmocks.py << EOF
- > # mock out util.makedate() to supply testable values
- > import os
- > from mercurial import pycompat, util
- > from mercurial.utils import dateutil
- >
- > def mockmakedate():
- > filename = os.path.join(os.environ['TESTTMP'], 'testtime')
- > try:
- > with open(filename, 'rb') as timef:
- > time = float(timef.read()) + 1
- > except IOError:
- > time = 0.0
- > with open(filename, 'wb') as timef:
- > timef.write(pycompat.bytestr(time))
- > return (time, 0)
- >
- > dateutil.makedate = mockmakedate
- > EOF
$ cat >> $HGRCPATH << EOF
> [extensions]
> amend=
- > testmocks=`pwd`/testmocks.py
+ > mockmakedate = $TESTDIR/mockmakedate.py
> EOF
$ hg init $TESTTMP/repo5