sapling/tests/mockblackbox.py
timeless 1ee6f788c8 tests: mock getpid to reduce glob usage
With util.getpid, it is now possible to define fixed pids.

Future iterations can define a map of pids on a locked
first come first serve basis to create a more realistic
harness, but for now this is good enough.

This applies to blackbox, but could apply to other
tests as well.
2016-02-03 04:37:04 +00:00

15 lines
284 B
Python

from mercurial import util
def makedate():
return 0, 0
def getuser():
return 'bob'
def getpid():
return 5000
# mock the date and user apis so the output is always the same
def uisetup(ui):
util.makedate = makedate
util.getuser = getuser
util.getpid = getpid