view tests/mockblackbox.py @ 50990:758e40b9a8af stable

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.
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 05 Oct 2023 14:47:42 -0300
parents 6000f5b25c9b
children 493034cc3265
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