D5577: tests: replaced mockmakedate function in test-amend.t
taapas1128 (Taapas Agrawal)
phabricator at mercurial-scm.org
Sun Jan 13 12:29:47 UTC 2019
taapas1128 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5577
AFFECTED FILES
tests/test-amend.t
CHANGE DETAILS
diff --git a/tests/test-amend.t b/tests/test-amend.t
--- a/tests/test-amend.t
+++ b/tests/test-amend.t
@@ -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
To: taapas1128, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list