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

login
register
mail settings
Submitter phabricator
Date Jan. 14, 2019, 2:38 a.m.
Message ID <dddb9d5df2708e7b2b07516a744ad5c9@localhost.localdomain>
Download mbox | patch
Permalink /patch/37718/
State Not Applicable
Headers show

Comments

phabricator - Jan. 14, 2019, 2:38 a.m.
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




To: taapas1128, #hg-reviewers
Cc: yuja, mercurial-devel

Patch

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