tests/mockblackbox.py
author Yuya Nishihara <yuya@tcha.org>
Mon, 03 Apr 2017 23:13:49 +0900
changeset 31928 277b3e2d711b
parent 28943 417380aa5bbe
child 32450 043948c84647
permissions -rw-r--r--
templater: add shorthand for building a dict like {"key": key} Like field init shorthand of Rust. This is convenient for building a JSON object from selected keywords. This means dict() won't support Python-like dict(iterable) syntax because it's ambiguous. Perhaps it could be implemented as 'mapdict(xs % (k, v))'.

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