view tests/mockblackbox.py @ 52029:921b8ad3feae

contrib: install pip 24.2 in the Windows dependency installer script One of the modern pythons was crying about the old version importing `distutils`.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 21 Oct 2024 11:48:09 -0400
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