tests/mockblackbox.py
author Yuya Nishihara <yuya@tcha.org>
Mon, 14 Mar 2016 00:06:52 +0900
changeset 28621 d856e85a8a7a
parent 28028 ac49ecb2a897
child 28943 417380aa5bbe
permissions -rw-r--r--
dispatch: make cmdalias forward command attributes to function This delays resolution of command attributes so that missing attributes can be warned only when necessary.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24705
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
from mercurial import util
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
def makedate():
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
    return 0, 0
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
def getuser():
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
    return 'bob'
28028
ac49ecb2a897 tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents: 24705
diff changeset
     7
def getpid():
ac49ecb2a897 tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents: 24705
diff changeset
     8
    return 5000
24705
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
# mock the date and user apis so the output is always the same
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
def uisetup(ui):
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
    util.makedate = makedate
0ead0a07ed9c tests: move mock blackbox extension into own file
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
    util.getuser = getuser
28028
ac49ecb2a897 tests: mock getpid to reduce glob usage
timeless <timeless@mozdev.org>
parents: 24705
diff changeset
    14
    util.getpid = getpid