Skip to content

Commit

Permalink
add cli test for invoice command
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Sep 8, 2024
1 parent b4f6ed8 commit 49b844c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/test_wallet_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from cashu.core.settings import settings
from cashu.wallet.cli.cli import cli
from cashu.wallet.wallet import Wallet
from tests.helpers import is_deprecated_api_only, is_fake, pay_if_regtest
from tests.helpers import is_deprecated_api_only, is_fake, is_regtest, pay_if_regtest


@pytest.fixture(autouse=True, scope="session")
Expand Down Expand Up @@ -108,6 +108,19 @@ def test_balance(cli_prefix):
assert result.exit_code == 0


@pytest.mark.skipif(is_regtest, reason="only works with FakeWallet")
def test_invoice(mint, cli_prefix):
runner = CliRunner()
result = runner.invoke(
cli,
[*cli_prefix, "invoice", "1000"],
)

wallet = asyncio.run(init_wallet())
assert wallet.available_balance >= 1000
assert result.exit_code == 0


def test_invoice_return_immediately(mint, cli_prefix):
runner = CliRunner()
result = runner.invoke(
Expand Down

0 comments on commit 49b844c

Please sign in to comment.