chainsyncer/tests/store/test_rocksdb.py

32 lines
672 B
Python
Raw Normal View History

2022-04-20 16:27:59 +02:00
# standard imports
import unittest
import logging
# local imports
from chainsyncer.store.rocksdb import SyncRocksDbStore
from chainsyncer.unittest.store import TestStoreBase
2022-04-20 16:27:59 +02:00
logging.basicConfig(level=logging.DEBUG)
logg = logging.getLogger()
class StoreFactory:
2022-04-20 16:27:59 +02:00
def __init__(self, path):
self.path = path
2022-04-20 16:27:59 +02:00
def create(self, session_id=None):
return SyncRocksDbStore(self.path, session_id=session_id)
2022-04-20 16:27:59 +02:00
class TestRocksDb(TestStoreBase):
def setUp(self):
super(TestRocksDb, self).setUp()
self.store_factory = StoreFactory(self.path).create
2022-04-20 16:27:59 +02:00
if __name__ == '__main__':
TestStoreBase.link(TestRocksDb)
2022-04-20 16:27:59 +02:00
unittest.main()