Mercurial > hg
view tests/mockblackbox.py @ 28696:efa192203623
templater: use templatefunc to mark a function as template function
Using decorator can localize changes for adding (or removing) a
template function in source code.
This patch also removes leading ":FUNC(ARG...):" part in help document
of each function, because using templatefunc makes it useless.
This patch uses not 'func' but 'templatefunc' as a decorator name,
because the former is too generic one, even though the latter is a
little redundant in 'templater.py'.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 30 Mar 2016 02:10:44 +0900 |
parents | ac49ecb2a897 |
children | 417380aa5bbe |
line wrap: on
line source
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