Split up backend modules
This commit is contained in:
@@ -5,7 +5,7 @@ import unittest
|
||||
from chainlib.chain import ChainSpec
|
||||
|
||||
# local imports
|
||||
from chainsyncer.backend import SyncerBackend
|
||||
from chainsyncer.backend.memory import MemBackend
|
||||
|
||||
# testutil imports
|
||||
from tests.base import TestBase
|
||||
@@ -15,7 +15,7 @@ class TestBasic(TestBase):
|
||||
|
||||
def test_hello(self):
|
||||
chain_spec = ChainSpec('evm', 'bloxberg', 8996, 'foo')
|
||||
backend = SyncerBackend(chain_spec, 'foo')
|
||||
backend = MemBackend(chain_spec, 'foo')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -8,7 +8,7 @@ from chainlib.chain import ChainSpec
|
||||
# local imports
|
||||
from chainsyncer.db.models.base import SessionBase
|
||||
from chainsyncer.db.models.filter import BlockchainSyncFilter
|
||||
from chainsyncer.backend import SyncerBackend
|
||||
from chainsyncer.backend.sql import SyncerBackend
|
||||
|
||||
# testutil imports
|
||||
from tests.base import TestBase
|
||||
@@ -67,6 +67,7 @@ class TestDatabase(TestBase):
|
||||
|
||||
session.close()
|
||||
|
||||
|
||||
def test_backend_retrieve(self):
|
||||
s = SyncerBackend.live(self.chain_spec, 42)
|
||||
s.register_filter('foo')
|
||||
|
||||
@@ -9,7 +9,7 @@ import shutil
|
||||
from chainlib.chain import ChainSpec
|
||||
|
||||
# local imports
|
||||
from chainsyncer.backend_file import SyncerFileBackend
|
||||
from chainsyncer.backend.file import SyncerFileBackend
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logg = logging.getLogger().getChild(__name__)
|
||||
|
||||
Reference in New Issue
Block a user