2022-03-17 15:54:34 +01:00
|
|
|
# standard imports
|
|
|
|
import unittest
|
|
|
|
import logging
|
|
|
|
|
|
|
|
# local imports
|
|
|
|
from chainsyncer.store.fs import SyncFsStore
|
2022-04-20 17:15:43 +02:00
|
|
|
from chainsyncer.unittest.store import TestStoreBase
|
2022-03-17 15:54:34 +01:00
|
|
|
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
logg = logging.getLogger()
|
|
|
|
|
|
|
|
|
2022-04-20 17:15:43 +02:00
|
|
|
class StoreFactory:
|
2022-03-17 15:54:34 +01:00
|
|
|
|
2022-04-20 17:15:43 +02:00
|
|
|
def __init__(self, path):
|
|
|
|
self.path = path
|
2022-03-17 23:07:19 +01:00
|
|
|
|
|
|
|
|
2022-04-20 17:15:43 +02:00
|
|
|
def create(self, session_id=None):
|
|
|
|
return SyncFsStore(self.path, session_id=session_id)
|
2022-03-17 23:07:19 +01:00
|
|
|
|
|
|
|
|
2022-04-20 17:15:43 +02:00
|
|
|
class TestFs(TestStoreBase):
|
2022-03-17 23:07:19 +01:00
|
|
|
|
2022-04-20 17:15:43 +02:00
|
|
|
def setUp(self):
|
|
|
|
super(TestFs, self).setUp()
|
|
|
|
self.store_factory = StoreFactory(self.path).create
|
2022-03-19 02:13:37 +01:00
|
|
|
|
|
|
|
|
2022-03-17 15:54:34 +01:00
|
|
|
if __name__ == '__main__':
|
2022-04-20 17:15:43 +02:00
|
|
|
TestStoreBase.link(TestFs)
|
2022-03-17 15:54:34 +01:00
|
|
|
unittest.main()
|