tests/mockblackbox.py
author Gregory Szorc <gregory.szorc@gmail.com>
Sun, 27 Mar 2016 14:18:32 -0700
changeset 28651 4827d07073e6
parent 28028 ac49ecb2a897
child 28943 417380aa5bbe
permissions -rw-r--r--
sslutil: always use SSLContext Now that we have a fake SSLContext instance, we can unify the code paths for wrapping sockets to always use the SSLContext APIs. Because this is security code, I've retained the try..except to make the diff easier to read. It will be removed in the next patch. I took the liberty of updating the inline docs about supported protocols and how the constants work because this stuff is important and needs to be explicitly documented.

from mercurial import util

def makedate():
    return 0, 0
def getuser():
    return 'bob'
def getpid():
    return 5000

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