Move store tests to separate dir, run last
This commit is contained in:
32
tests/store/test_1_fs.py
Normal file
32
tests/store/test_1_fs.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# standard imports
|
||||
import unittest
|
||||
import logging
|
||||
|
||||
# local imports
|
||||
from chainsyncer.store.fs import SyncFsStore
|
||||
from chainsyncer.unittest.store import TestStoreBase
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logg = logging.getLogger()
|
||||
|
||||
|
||||
class StoreFactory:
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
|
||||
|
||||
def create(self, session_id=None):
|
||||
return SyncFsStore(self.path, session_id=session_id)
|
||||
|
||||
|
||||
class TestFs(TestStoreBase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestFs, self).setUp()
|
||||
self.store_factory = StoreFactory(self.path).create
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
TestStoreBase.link(TestFs)
|
||||
unittest.main()
|
||||
31
tests/store/test_rocksdb.py
Normal file
31
tests/store/test_rocksdb.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# standard imports
|
||||
import unittest
|
||||
import logging
|
||||
|
||||
# local imports
|
||||
from chainsyncer.store.rocksdb import SyncRocksDbStore
|
||||
from chainsyncer.unittest.store import TestStoreBase
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logg = logging.getLogger()
|
||||
|
||||
class StoreFactory:
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
|
||||
|
||||
def create(self, session_id=None):
|
||||
return SyncRocksDbStore(self.path, session_id=session_id)
|
||||
|
||||
|
||||
class TestRocksDb(TestStoreBase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestRocksDb, self).setUp()
|
||||
self.store_factory = StoreFactory(self.path).create
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
TestStoreBase.link(TestRocksDb)
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user