tests/test-storage.py
changeset 39953 a3a9b93bff80
parent 39772 ae531f5e583c
child 40051 cdf61ab1f54c
equal deleted inserted replaced
39952:75452c1e68f6 39953:a3a9b93bff80
    21     'vfs': vfsmod.vfs(b'.', realpath=True),
    21     'vfs': vfsmod.vfs(b'.', realpath=True),
    22 }
    22 }
    23 
    23 
    24 def makefilefn(self):
    24 def makefilefn(self):
    25     """Factory for filelog instances."""
    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     STATE['lastindex'] += 1
    27     STATE['lastindex'] += 1
    28     return fl
    28     return fl
    29 
    29 
    30 def maketransaction(self):
    30 def maketransaction(self):
    31     vfsmap = {'plain': STATE['vfs']}
    31     vfsmap = {'plain': STATE['vfs']}
    32 
    32 
    33     return transaction.transaction(STATE['ui'].warn, STATE['vfs'], vfsmap,
    33     return transaction.transaction(STATE['ui'].warn, STATE['vfs'], vfsmap,
    34                                   'journal', 'undo')
    34                                    b'journal', b'undo')
    35 
    35 
    36 # Assigning module-level attributes that inherit from unittest.TestCase
    36 # Assigning module-level attributes that inherit from unittest.TestCase
    37 # is all that is needed to register tests.
    37 # is all that is needed to register tests.
    38 filelogindextests = storagetesting.makeifileindextests(makefilefn,
    38 filelogindextests = storagetesting.makeifileindextests(makefilefn,
    39                                                        maketransaction)
    39                                                        maketransaction)