D5577: tests: replaced mockmakedate function in test-amend.t

taapas1128 (Taapas Agrawal) phabricator at mercurial-scm.org
Sun Jan 13 21:38:19 EST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8633c716f908: tests: replace mockmakedate function in test-amend.t (authored by taapas1128, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5577?vs=13203&id=13207

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: yuja, mercurial-devel


More information about the Mercurial-devel mailing list