##// END OF EJS Templates
py3: byteify test-storage.py...
Gregory Szorc -
r39989:a3a9b93b default
parent child Browse files
Show More
@@ -1,46 +1,46
1 1 # This test verifies the conformance of various classes to various
2 2 # storage interfaces.
3 3 from __future__ import absolute_import
4 4
5 5 import silenttestrunner
6 6
7 7 from mercurial import (
8 8 filelog,
9 9 transaction,
10 10 ui as uimod,
11 11 vfs as vfsmod,
12 12 )
13 13
14 14 from mercurial.testing import (
15 15 storage as storagetesting,
16 16 )
17 17
18 18 STATE = {
19 19 'lastindex': 0,
20 20 'ui': uimod.ui(),
21 21 'vfs': vfsmod.vfs(b'.', realpath=True),
22 22 }
23 23
24 24 def makefilefn(self):
25 25 """Factory for filelog instances."""
26 fl = filelog.filelog(STATE['vfs'], 'filelog-%d' % STATE['lastindex'])
26 fl = filelog.filelog(STATE['vfs'], b'filelog-%d' % STATE['lastindex'])
27 27 STATE['lastindex'] += 1
28 28 return fl
29 29
30 30 def maketransaction(self):
31 31 vfsmap = {'plain': STATE['vfs']}
32 32
33 33 return transaction.transaction(STATE['ui'].warn, STATE['vfs'], vfsmap,
34 'journal', 'undo')
34 b'journal', b'undo')
35 35
36 36 # Assigning module-level attributes that inherit from unittest.TestCase
37 37 # is all that is needed to register tests.
38 38 filelogindextests = storagetesting.makeifileindextests(makefilefn,
39 39 maketransaction)
40 40 filelogdatatests = storagetesting.makeifiledatatests(makefilefn,
41 41 maketransaction)
42 42 filelogmutationtests = storagetesting.makeifilemutationtests(makefilefn,
43 43 maketransaction)
44 44
45 45 if __name__ == '__main__':
46 46 silenttestrunner.main(__name__)
General Comments 0
You need to be logged in to leave comments. Login now