Show More
@@ -368,30 +368,11 b' When backup-bundle config option is set:' | |||
|
368 | 368 | ========================================== |
|
369 | 369 | Test update-timestamp config option| |
|
370 | 370 | ========================================== |
|
371 | $ cat >> testmocks.py << EOF | |
|
372 | > # mock out util.makedate() to supply testable values | |
|
373 | > import os | |
|
374 | > from mercurial import pycompat, util | |
|
375 | > from mercurial.utils import dateutil | |
|
376 | > | |
|
377 | > def mockmakedate(): | |
|
378 | > filename = os.path.join(os.environ['TESTTMP'], 'testtime') | |
|
379 | > try: | |
|
380 | > with open(filename, 'rb') as timef: | |
|
381 | > time = float(timef.read()) + 1 | |
|
382 | > except IOError: | |
|
383 | > time = 0.0 | |
|
384 | > with open(filename, 'wb') as timef: | |
|
385 | > timef.write(pycompat.bytestr(time)) | |
|
386 | > return (time, 0) | |
|
387 | > | |
|
388 | > dateutil.makedate = mockmakedate | |
|
389 | > EOF | |
|
390 | 371 | |
|
391 | 372 |
$ |
|
392 | 373 | > [extensions] |
|
393 | 374 | > amend= |
|
394 | > testmocks=`pwd`/testmocks.py | |
|
375 | > mockmakedate = $TESTDIR/mockmakedate.py | |
|
395 | 376 | > EOF |
|
396 | 377 | |
|
397 | 378 |
$ |
General Comments 0
You need to be logged in to leave comments.
Login now