tests/mockblackbox.py
author Anton Shestakov <av6@dwimlabs.net>
Thu, 05 Oct 2023 14:47:42 -0300
branchstable
changeset 50990 758e40b9a8af
parent 48875 6000f5b25c9b
child 51690 493034cc3265
permissions -rw-r--r--
httppeer: fix static-http: scheme autodetection (issue6833) Since statichttprepo.make_peer() assumes path is a urlutil.path object (by accessing path.loc), we no longer can just provide a bytestring there. See also 5f71fff8dc74 and cfe8d88a453e.

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