Add nonce list test
This commit is contained in:
@@ -20,6 +20,7 @@ from chainqueue.tx import create
|
||||
|
||||
script_dir = os.path.realpath(os.path.dirname(__file__))
|
||||
|
||||
logging.basicConfig(level=logging.WARNING)
|
||||
logg = logging.getLogger().getChild(__name__)
|
||||
|
||||
|
||||
@@ -44,7 +45,7 @@ class TestBase(unittest.TestCase):
|
||||
SessionBase.poolable = False
|
||||
SessionBase.transactional = False
|
||||
SessionBase.procedural = False
|
||||
SessionBase.connect(dsn, debug=False)
|
||||
SessionBase.connect(dsn, debug=True)
|
||||
|
||||
ac = alembic.config.Config(os.path.join(migrationsdir, 'alembic.ini'))
|
||||
ac.set_main_option('sqlalchemy.url', dsn)
|
||||
|
||||
@@ -5,6 +5,7 @@ import unittest
|
||||
from chainqueue.db.models.tx import TxCache
|
||||
from chainqueue.error import NotLocalTxError
|
||||
from chainqueue.state import *
|
||||
from chainqueue.query import get_tx_cache
|
||||
|
||||
# test imports
|
||||
from tests.base import TestTxBase
|
||||
@@ -31,5 +32,10 @@ class TestTxCache(TestTxBase):
|
||||
self.assertEqual(txc.tx_index, 13)
|
||||
|
||||
|
||||
def test_get(self):
|
||||
tx_extended_dict = get_tx_cache(self.chain_spec, self.tx_hash)
|
||||
self.assertEqual(tx_extended_dict['tx_hash'], self.tx_hash)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user