tests/mockblackbox.py
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 08 Oct 2016 19:02:44 +0200
changeset 30091 d576b7394646
parent 28943 417380aa5bbe
child 32450 043948c84647
permissions -rw-r--r--
util: define PyInt_Type on Python 3 util.h attempts to wallpaper over C API differences between Python 2 and 3. This is not the correct approach where performance is critical. But it is good enough for the current state of the Python 3 port.

from __future__ import absolute_import
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