tests/mockblackbox.py
author Yuya Nishihara <yuya@tcha.org>
Sun, 27 Dec 2015 17:59:57 +0900
changeset 28212 d4419c01532b
parent 28028 ac49ecb2a897
child 28943 417380aa5bbe
permissions -rw-r--r--
templatefilters: make json filter be byte-transparent (BC) (issue4926) This is necessary to preserve filename encoding over JSON. Instead, this patch inserts "|utf8" where non-ascii local-encoding texts can be passed to "|json". See also the commit that introduced "utf8" filter.

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