tests/mockblackbox.py
changeset 43076 2372284d9457
parent 37123 a8a902d7176e
child 48966 6000f5b25c9b
equal deleted inserted replaced
43075:57875cf423c9 43076:2372284d9457
     1 from __future__ import absolute_import
     1 from __future__ import absolute_import
     2 from mercurial.utils import (
     2 from mercurial.utils import procutil
     3     procutil,
       
     4 )
       
     5 
     3 
     6 # XXX: we should probably offer a devel option to do this in blackbox directly
     4 # XXX: we should probably offer a devel option to do this in blackbox directly
     7 def getuser():
     5 def getuser():
     8     return b'bob'
     6     return b'bob'
       
     7 
       
     8 
     9 def getpid():
     9 def getpid():
    10     return 5000
    10     return 5000
       
    11 
    11 
    12 
    12 # mock the date and user apis so the output is always the same
    13 # mock the date and user apis so the output is always the same
    13 def uisetup(ui):
    14 def uisetup(ui):
    14     procutil.getuser = getuser
    15     procutil.getuser = getuser
    15     procutil.getpid = getpid
    16     procutil.getpid = getpid