Skip to content

Commit

Permalink
feat: add unit test for empty config file
Browse files Browse the repository at this point in the history
  • Loading branch information
aimxhaisse committed Nov 20, 2023
1 parent a3c03e3 commit 94cd415
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/config/.#test_load_config.py
Empty file added tests/config/__init__.py
Empty file.
Empty file added tests/config/assets/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions tests/config/assets/config.empty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
beacon_url: ~
beacon_type: ~
execution_url: ~
web3signer_url: ~
default_fee_recipient: ~
slack_channel: ~
slack_token: ~
relay_url: ~
liveness_file: ~
watched_keys: ~
16 changes: 16 additions & 0 deletions tests/config/assets/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Example config file for the Ethereum watcher.

beacon_url: http://localhost:5051/
beacon_type: other
execution_url: http://localhost:8545/
web3signer_url: http://web3signer:9000/
default_fee_recipient: 0x41bF25fC8C52d292bD66D3BCEcd8a919ecB9EF88
slack_channel: '#ethereum-monitoring'
slack_token: 'secret'
relay_url: http://relay1,http://relay2
liveness_file: /tmp/i-am-alive

watched_keys:
- public_key: 0x832b8286f5d6535fd941c6c4ed8b9b20d214fc6aa726ce4fba1c9dbb4f278132646304f550e557231b6932aa02cf08d3
labels: ["google"]
fee_recipient: ~
8 changes: 8 additions & 0 deletions tests/config/test_load_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from pathlib import Path

from eth_validator_watcher.config import load_config


def test_empty_config() -> None:
Path(assets.__file__).parent / ""
config = load_config()

0 comments on commit 94cd415

Please sign in to comment.