Skip to content

Commit

Permalink
feat: add test for invalid config
Browse files Browse the repository at this point in the history
  • Loading branch information
aimxhaisse committed Nov 21, 2023
1 parent e423d10 commit 8c58bf9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Empty file.
1 change: 1 addition & 0 deletions tests/entrypoint/assets/invalid_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
beacon_type: 42
17 changes: 13 additions & 4 deletions tests/entrypoint/test__handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
from pathlib import Path
from typing import Iterator, List, Optional, Tuple

from freezegun import freeze_time
from pytest import raises
from typer import BadParameter

from eth_validator_watcher import entrypoint
from eth_validator_watcher.config import WatchedKeyConfig
from eth_validator_watcher.entrypoint import _handler
from eth_validator_watcher.entrypoint import handler, _handler
from eth_validator_watcher.models import BeaconType, Genesis, Validators
from eth_validator_watcher.utils import LimitedDict, Slack
from eth_validator_watcher.web3signer import Web3Signer
from freezegun import freeze_time
from pytest import raises
from typer import BadParameter
from tests.entrypoint import assets

StatusEnum = Validators.DataItem.StatusEnum
Validator = Validators.DataItem.Validator
Expand Down Expand Up @@ -335,3 +337,10 @@ def write_liveness_file(liveness_file: Path) -> None:
)

assert Coinbase.nb_calls == 2


def test_invalid_config() -> None:
path = Path(assets.__file__).parent / "invalid_config.yaml"

with raises(BadParameter):
handler(path)

0 comments on commit 8c58bf9

Please sign in to comment.