Skip to content
Snippets Groups Projects
Commit e5ea96ac authored by Moul's avatar Moul
Browse files

[test] Make use of FAILURE_EXIT_STATUS constant

parent 1fb74479
No related branches found
No related tags found
2 merge requests!146Merge dev into master branch to complete v0.8.0 development cycle,!132Multiple enhancements
...@@ -3,7 +3,7 @@ from click.testing import CliRunner ...@@ -3,7 +3,7 @@ from click.testing import CliRunner
from silkaj.tx import transaction_amount from silkaj.tx import transaction_amount
from silkaj.money import UDValue from silkaj.money import UDValue
from silkaj.cli import cli from silkaj.cli import cli
from silkaj.constants import MINIMAL_TX_AMOUNT from silkaj.constants import MINIMAL_TX_AMOUNT, FAILURE_EXIT_STATUS
@pytest.mark.asyncio @pytest.mark.asyncio
...@@ -66,14 +66,14 @@ def test_tx_passed_amount_cli(): ...@@ -66,14 +66,14 @@ def test_tx_passed_amount_cli():
result = CliRunner().invoke(cli, ["tx", "-r", "A"]) result = CliRunner().invoke(cli, ["tx", "-r", "A"])
assert "Error: amount, amountUD or allSources is not set." in result.output assert "Error: amount, amountUD or allSources is not set." in result.output
assert result.exit_code == 1 assert result.exit_code == FAILURE_EXIT_STATUS
result = CliRunner().invoke(cli, ["tx", "-r", "A", "-r", "B", "--allSources"]) result = CliRunner().invoke(cli, ["tx", "-r", "A", "-r", "B", "--allSources"])
assert ( assert (
"Error: the --allSources option can only be used with one recipient." "Error: the --allSources option can only be used with one recipient."
in result.output in result.output
) )
assert result.exit_code == 1 assert result.exit_code == FAILURE_EXIT_STATUS
result = CliRunner().invoke(cli, ["tx", "-r", "A", "-a", MINIMAL_TX_AMOUNT - 0.001]) result = CliRunner().invoke(cli, ["tx", "-r", "A", "-a", MINIMAL_TX_AMOUNT - 0.001])
assert 'Error: Invalid value for "--amount"' in result.output assert 'Error: Invalid value for "--amount"' in result.output
...@@ -84,7 +84,7 @@ def test_tx_passed_amount_cli(): ...@@ -84,7 +84,7 @@ def test_tx_passed_amount_cli():
"Error: The number of passed recipients is not the same as the passed amounts." "Error: The number of passed recipients is not the same as the passed amounts."
in result.output in result.output
) )
assert result.exit_code == 1 assert result.exit_code == FAILURE_EXIT_STATUS
result = CliRunner().invoke( result = CliRunner().invoke(
cli, ["tx", "-r", "A", "-r", "B", "-r", "C", "-a", 1, "-a", 2] cli, ["tx", "-r", "A", "-r", "B", "-r", "C", "-a", 1, "-a", 2]
...@@ -93,4 +93,4 @@ def test_tx_passed_amount_cli(): ...@@ -93,4 +93,4 @@ def test_tx_passed_amount_cli():
"Error: The number of passed recipients is not the same as the passed amounts." "Error: The number of passed recipients is not the same as the passed amounts."
in result.output in result.output
) )
assert result.exit_code == 1 assert result.exit_code == FAILURE_EXIT_STATUS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment