Added tests
This commit is contained in:
parent
af1aae3fc2
commit
5ada6e20b1
BIN
test/example-abis/mpc_token.abi
Normal file
BIN
test/example-abis/mpc_token.abi
Normal file
Binary file not shown.
BIN
test/example-abis/transaction_and_event_deserialization.abi
Normal file
BIN
test/example-abis/transaction_and_event_deserialization.abi
Normal file
Binary file not shown.
18
test/test_parse_abi.py
Normal file
18
test/test_parse_abi.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import pytest
|
||||||
|
from pathlib import Path
|
||||||
|
from pbcabi.binaryreader import BinaryReader
|
||||||
|
import pbcabi.model
|
||||||
|
|
||||||
|
EXAMPLE_ABIS_FOLDER = Path.cwd() / 'test' / 'example-abis'
|
||||||
|
EXAMPLE_ABIS = list(EXAMPLE_ABIS_FOLDER.glob('*.abi'))
|
||||||
|
|
||||||
|
def test_parse_abi_num():
|
||||||
|
print(EXAMPLE_ABIS_FOLDER)
|
||||||
|
print(EXAMPLE_ABIS)
|
||||||
|
assert len(EXAMPLE_ABIS) > 0
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('abi_file_path', EXAMPLE_ABIS)
|
||||||
|
def test_parse_abi(abi_file_path):
|
||||||
|
with open(abi_file_path, 'rb') as f:
|
||||||
|
contract_abi = pbcabi.model.FileAbi.read_from(BinaryReader(f.read()))
|
||||||
|
assert contract_abi is not None
|
Loading…
Reference in New Issue
Block a user