fix flake8 E712 (comparison-to-bool)

This commit is contained in:
Pavol Rusnak 2023-01-21 15:02:35 +00:00
parent 9ef4bd8fb9
commit f6bd8684d3
No known key found for this signature in database
GPG key ID: 91F3B339B9A02A3D
16 changed files with 32 additions and 32 deletions

View file

@ -127,7 +127,7 @@ async def test_check_payment_without_key(client, invoice):
# check the payment status
response = await client.get(f"/api/v1/payments/{invoice['payment_hash']}")
assert response.status_code < 300
assert response.json()["paid"] == True
assert response.json()["paid"] is True
assert invoice
# not key, that's why no "details"
assert "details" not in response.json()
@ -145,7 +145,7 @@ async def test_check_payment_with_key(client, invoice, inkey_headers_from):
f"/api/v1/payments/{invoice['payment_hash']}", headers=inkey_headers_from
)
assert response.status_code < 300
assert response.json()["paid"] == True
assert response.json()["paid"] is True
assert invoice
# with key, that's why with "details"
assert "details" in response.json()
@ -205,7 +205,7 @@ async def test_api_payment_without_key(invoice):
# check the payment status
response = await api_payment(invoice["payment_hash"])
assert type(response) == dict
assert response["paid"] == True
assert response["paid"] is True
# no key, that's why no "details"
assert "details" not in response
@ -218,7 +218,7 @@ async def test_api_payment_with_key(invoice, inkey_headers_from):
invoice["payment_hash"], inkey_headers_from["X-Api-Key"]
)
assert type(response) == dict
assert response["paid"] == True
assert response["paid"] is True
assert "details" in response

View file

@ -115,7 +115,7 @@ async def test_bleskomat_lnurl_api_action_insufficient_balance(client, lnurl):
assert wallet.balance_msat == 0
bleskomat_lnurl = await get_bleskomat_lnurl(secret)
assert bleskomat_lnurl, not None
assert bleskomat_lnurl.has_uses_remaining() == True
assert bleskomat_lnurl.has_uses_remaining() is True
WALLET.pay_invoice.assert_not_called()
@ -140,5 +140,5 @@ async def test_bleskomat_lnurl_api_action_success(client, lnurl):
assert wallet.balance_msat == 50000
bleskomat_lnurl = await get_bleskomat_lnurl(secret)
assert bleskomat_lnurl, not None
assert bleskomat_lnurl.has_uses_remaining() == False
assert bleskomat_lnurl.has_uses_remaining() is False
WALLET.pay_invoice.assert_called_once_with(pr, 2000)

View file

@ -80,7 +80,7 @@ async def test_invoices_api_partial_pay_invoice(
f"/invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash}"
)
assert response.status_code == 200
assert response.json()["paid"] == True
assert response.json()["paid"] is True
# check invoice status
response = await client.get(f"/invoices/api/v1/invoice/{invoice_id}")
@ -124,7 +124,7 @@ async def test_invoices_api_partial_pay_invoice(
# f"/invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash}"
# )
# assert response.status_code == 200
# assert response.json()["paid"] == True
# assert response.json()["paid"] is True
# # check invoice status
# response = await client.get(f"/invoices/api/v1/invoice/{invoice_id}")