##// END OF EJS Templates
annotate: rename {line_number} to {lineno} (BC)...
annotate: rename {line_number} to {lineno} (BC) I think {lineno} looks more like a common template keyword. It isn't called a {line} to avoid conflicts with the element name of {lines} and the {_|splitlines} filter. https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary

File last commit:

r39808:ae531f5e default
r39965:47cb6750 default
Show More
test-storage.py
46 lines | 1.4 KiB | text/x-python | PythonLexer
# This test verifies the conformance of various classes to various
# storage interfaces.
from __future__ import absolute_import
import silenttestrunner
from mercurial import (
filelog,
transaction,
ui as uimod,
vfs as vfsmod,
)
from mercurial.testing import (
storage as storagetesting,
)
STATE = {
'lastindex': 0,
'ui': uimod.ui(),
'vfs': vfsmod.vfs(b'.', realpath=True),
}
def makefilefn(self):
"""Factory for filelog instances."""
fl = filelog.filelog(STATE['vfs'], 'filelog-%d' % STATE['lastindex'])
STATE['lastindex'] += 1
return fl
def maketransaction(self):
vfsmap = {'plain': STATE['vfs']}
return transaction.transaction(STATE['ui'].warn, STATE['vfs'], vfsmap,
'journal', 'undo')
# Assigning module-level attributes that inherit from unittest.TestCase
# is all that is needed to register tests.
filelogindextests = storagetesting.makeifileindextests(makefilefn,
maketransaction)
filelogdatatests = storagetesting.makeifiledatatests(makefilefn,
maketransaction)
filelogmutationtests = storagetesting.makeifilemutationtests(makefilefn,
maketransaction)
if __name__ == '__main__':
silenttestrunner.main(__name__)