Prepare integration test

This commit is contained in:
lash
2022-03-12 13:48:40 +00:00
parent 69ad3711cd
commit 0c9b42d086
8 changed files with 128 additions and 168 deletions

View File

@@ -4,6 +4,7 @@ import unittest
# external imports
from shep.store.file import SimpleFileStoreFactory
from chainlib.chain import ChainSpec
# local imports
from chainqueue import (
@@ -11,6 +12,10 @@ from chainqueue import (
Status,
)
# test imports
from tests.common import MockCounter
class MockContentStore:
@@ -26,18 +31,6 @@ class MockContentStore:
return self.store.get(k)
class MockCounter:
def __init__(self):
self.c = 0
def next(self):
c = self.c
self.c += 1
return c
class TestShepBase(unittest.TestCase):
def setUp(self):
@@ -46,4 +39,5 @@ class TestShepBase(unittest.TestCase):
self.state = Status(factory)
content_store = MockContentStore()
counter = MockCounter()
self.store = Store(self.state, content_store, counter)
chain_spec = ChainSpec('foo', 'bar', 42, 'baz')
self.store = Store(chain_spec, self.state, content_store, counter)