Skip to content

Commit

Permalink
Use parametrized test to parse all registry descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaireGuerreGiordano committed Sep 16, 2024
1 parent 155d50c commit a33039f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/src/erc7730/test_datamodel.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from pathlib import Path
from erc7730.common.pydantic import model_from_json_file_or_none
from erc7730.model.erc7730_descriptor import ERC7730Descriptor
import pytest
import glob

def test_from_erc7730() -> None:
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/makerdao/eip712-permit-DAI.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/aave/calldata-lpv2.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/lido/calldata-stETH.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/lido/calldata-wstETH.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/paraswap/calldata-AugustusSwapper.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/tether/calldata-usdt.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/uniswap/calldata-UniswapV3Router02.json"), ERC7730Descriptor) is not None
assert model_from_json_file_or_none(Path("clear-signing-erc7730-registry/registry/uniswap/eip712-permit2.json"), ERC7730Descriptor) is not None
files = glob.glob('clear-signing-erc7730-registry/registry/*/*.json')

@pytest.mark.parametrize("file", files)
def test_from_erc7730(file: str) -> None:
assert model_from_json_file_or_none(Path(file), ERC7730Descriptor) is not None

0 comments on commit a33039f

Please sign in to comment.