-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use parametrized test to parse all registry descriptors
- Loading branch information
1 parent
155d50c
commit a33039f
Showing
1 changed file
with
7 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |