changeset 41214:8633c716f908

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
author Taapas Agrawal <taapas2897@gmail.com>
date Sun, 13 Jan 2019 17:56:02 +0530
parents 704a3aa3dc0a
children 6242a19004ca
files tests/test-amend.t
diffstat 1 files changed, 1 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- 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