func tests: run black

This commit is contained in:
jp1ac4 2023-11-21 13:01:38 +00:00
parent 7011210fc2
commit fdab722eff
No known key found for this signature in database
GPG Key ID: A7ACD32423568D7B
4 changed files with 14 additions and 5 deletions

View File

@ -405,6 +405,7 @@ def test_conflicting_unconfirmed_spend_txs(lianad, bitcoind):
if coin["spend_info"] is None:
return False
return coin["spend_info"]["txid"] == txid.hex()
wait_for(lambda: is_spent_by(lianad, spent_coin["outpoint"], txid_b))

View File

@ -26,7 +26,7 @@ OLD_LIANAD_PATH = os.getenv("OLD_LIANAD_PATH", None)
IS_BITCOIND_25 = bool(int(os.getenv("IS_BITCOIND_25", True)))
COIN = 10 ** 8
COIN = 10**8
def wait_for(success, timeout=TIMEOUT, debug_fn=None):

View File

@ -274,7 +274,9 @@ def test_migration(lianad_multisig, bitcoind):
assert len(spend_txs) == 2 and all(s["updated_at"] is not None for s in spend_txs)
@pytest.mark.skipif(not IS_BITCOIND_25, reason="Need 'generateblock' with 'submit=False'")
@pytest.mark.skipif(
not IS_BITCOIND_25, reason="Need 'generateblock' with 'submit=False'"
)
def test_bitcoind_submit_block(bitcoind):
block_count = bitcoind.rpc.getblockcount()
block = bitcoind.rpc.generateblock(bitcoind.rpc.getnewaddress(), [], False)
@ -294,7 +296,9 @@ def bitcoind_wait_new_block(bitcoind):
continue
@pytest.mark.skipif(not IS_BITCOIND_25, reason="Need 'generateblock' with 'submit=False'")
@pytest.mark.skipif(
not IS_BITCOIND_25, reason="Need 'generateblock' with 'submit=False'"
)
def test_retry_on_workqueue_exceeded(lianad, bitcoind, executor):
"""Make sure we retry requests to bitcoind if it is temporarily overloaded."""
# Start by reducing the work queue to a single slot. Note we need to stop lianad
@ -363,5 +367,7 @@ def test_wo_wallet_copy_from_bitcoind_datadir(lianad, bitcoind):
# Now restart lianad. It should detect it within the bitcoind datadir and copy it to its own.
lianad.start()
assert os.path.isdir(new_wo_path)
assert lianad.is_in_log("A data directory exists with no watchonly wallet. This is most likely due to.*")
assert lianad.is_in_log(
"A data directory exists with no watchonly wallet. This is most likely due to.*"
)
assert lianad.is_in_log("Successfully copied the watchonly wallet file.")

View File

@ -391,5 +391,7 @@ def test_sweep(lianad, bitcoind):
sign_and_broadcast_psbt(lianad, psbt)
wait_for(lambda: len(lianad.rpc.listcoins(["unconfirmed"])["coins"]) == 1)
wait_for(lambda: len(lianad.rpc.listcoins(["confirmed"])["coins"]) == 2)
balance = sum(c["amount"] for c in lianad.rpc.listcoins(["unconfirmed", "confirmed"])["coins"])
balance = sum(
c["amount"] for c in lianad.rpc.listcoins(["unconfirmed", "confirmed"])["coins"]
)
assert balance == int((0.2 + 0.1 + 0.3) * COIN)