cic-cli/tests/eth/test_eth_offline.py

34 lines
890 B
Python
Raw Normal View History

2021-10-10 13:20:00 +02:00
# standard imports
import unittest
# local imports
from cic.ext.eth import CICEth
# tests imports
from tests.eth.base_eth import TestCICEthBase
class TestCICEthOffline(TestCICEthBase):
def setUp(self):
super(TestCICEthOffline, self).setUp()
self.adapter = CICEth(self.chain_spec, self.resources, self.proofs)
def test_offline_token_index(self):
self.adapter.token_address = self.token_address
v = self.adapter.process_token_index()
2021-10-10 14:00:47 +02:00
self.assertEqual(self.adapter.outputs[0], v)
self.assertEqual(self.adapter.outputs[0][:8], '4420e486')
2021-10-10 13:20:00 +02:00
2021-10-10 14:00:47 +02:00
def test_offline_address_declarator(self):
2021-10-10 14:06:40 +02:00
self.adapter.token_address = self.token_address
v = self.adapter.process_address_declarator()
self.assertEqual(v[0][:8], 'ae47ece0')
self.assertEqual(len(v), 3)
2021-10-10 14:00:47 +02:00
2021-10-10 15:37:26 +02:00
2021-10-10 13:20:00 +02:00
if __name__ == '__main__':
unittest.main()