view tests/mockblackbox.py @ 51972:dd3ccda3abc8

branchmap-v3: detect invalid headerline and raise error Otherwise, broken cache file would be accept as valid, but empty.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 27 Sep 2024 02:27:54 +0200
parents ca7bde5dbafb
children
line wrap: on
line source

from mercurial.utils import procutil


# XXX: we should probably offer a devel option to do this in blackbox directly
def getuser():
    return b'bob'


def getpid():
    return 5000


# mock the date and user apis so the output is always the same
def uisetup(ui):
    procutil.getuser = getuser
    procutil.getpid = getpid