Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Nov 6, 2023
1 parent 36e6a05 commit eb5d658
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/test_onchain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import pytest

from boltz_client.onchain import validate_address


@pytest.mark.asyncio
@pytest.mark.parametrize(
"addr, network",
[
("bc1asdkljalskdj", "main"),
("bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", "test"),
("bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", "regtest"),
("bcrt1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", "regtest"),
("026165850492521f4ac8abd9bd8088123446d126f648ca35e60f88177dc149ceb2", "main"),
],
)
async def test_invalid_address(addr, network):
with pytest.raises(ValueError):
validate_address(addr, network)


@pytest.mark.asyncio
@pytest.mark.parametrize(
"addr, network",
[
("bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", "main"),
("bcrt1qky0es27zfejlr3grpfl4pj47w7yfm0atwqdf3y", "regtest"),
],
)
async def test_valid_address(addr, network):
validate_address(addr, network)

0 comments on commit eb5d658

Please sign in to comment.