Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,21 @@ jobs:

- name: "Run tests"
run: python -m unittest discover --start "./tests/" --pattern "test_offline_*.py" --verbose

ruff:
name: "Lint tests"
runs-on: ubuntu-latest
defaults:
run:
working-directory: bdk-python
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
submodules: true

- name: "Install Ruff"
run: curl -LsSf https://astral.sh/ruff/install.sh | sh

- name: "Lint test targets"
run: ruff check ./tests/
12 changes: 9 additions & 3 deletions bdk-python/tests/test_live_kyoto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from bdkpython import *
from bdkpython import Connection, Client, Network, Descriptor, KeychainKind, LightClientBuilder, LightClient, LightNode, IpAddress, ScanType, Peer, Update, Wallet
import unittest
import os
import asyncio
Expand Down Expand Up @@ -39,10 +39,16 @@ async def testKyoto(self) -> None:
light_client: LightClient = LightClientBuilder().scan_type(ScanType.NEW()).peers(peers).connections(1).build(wallet)
client: Client = light_client.client
node: LightNode = light_client.node
async def log_loop(client: Client):
while True:
log = await client.next_log()
print(log)
log_task = asyncio.create_task(log_loop(client))
node.run()
update: Update = await client.update()
update: Update | None = await client.update()
self.assertIsNotNone(update, "Update is None. This should not be possible.")
wallet.apply_update(update)
if update is not None:
wallet.apply_update(update)
self.assertGreater(
wallet.balance().total.to_sat(),
0,
Expand Down
Loading