tests/mockblackbox.py
author Zharaskhan Aman <aman.zharaskhan@gmail.com>
Fri, 05 Oct 2018 01:55:51 +0300
changeset 40081 a4d62ff9a86d
parent 37120 a8a902d7176e
child 43076 2372284d9457
permissions -rw-r--r--
obsolete: fix ValueError when stored note contains ':' char (issue5783) The newer version of `amend -n 'Some some'` accepts containing ':' char. The information contained in this note 'Testing::Obstore' gives ValueError, because we are trying to store more than 2 values in key and value. Differential Revision: https://phab.mercurial-scm.org/D4883 Differential Revision: https://phab.mercurial-scm.org/D4882

from __future__ import absolute_import
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