tests/mockblackbox.py
author Yuya Nishihara <yuya@tcha.org>
Sun, 14 Feb 2016 12:42:25 +0900
changeset 28343 a6c2310b3827
parent 28028 ac49ecb2a897
child 28943 417380aa5bbe
permissions -rw-r--r--
templater: factor out function that evaluates argument as integer We have more bare int()s that may raise ValueError or TypeError. This function will be used to fix them.

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