From abaa57418e7a3339f5255fe0ed0dcaddbb63cfbf Mon Sep 17 00:00:00 2001 From: matograine <tom.ngr@zaclys.net> Date: Thu, 10 Dec 2020 10:50:25 +0100 Subject: [PATCH] [test] #362 add an error case in test_tx_passed_amount_cli * --amountUD in inferior to 1e-6 --- tests/test_tx.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_tx.py b/tests/test_tx.py index 9f871c92..e294d67a 100644 --- a/tests/test_tx.py +++ b/tests/test_tx.py @@ -23,6 +23,7 @@ from silkaj.money import UDValue from silkaj.cli import cli from silkaj.constants import ( MINIMAL_ABSOLUTE_TX_AMOUNT, + MINIMAL_RELATIVE_TX_AMOUNT, FAILURE_EXIT_STATUS, CENT_MULT_TO_UNIT, ) @@ -169,6 +170,12 @@ def test_tx_passed_amount_cli(): assert "Error: Invalid value for '--amount'" in result.output assert result.exit_code == 2 + result = CliRunner().invoke( + cli, ["tx", "-r", "A", "-d", MINIMAL_RELATIVE_TX_AMOUNT - 0.0000001] + ) + assert "Error: Invalid value for '--amountUD'" in result.output + assert result.exit_code == 2 + result = CliRunner().invoke(cli, ["tx", "-r", "A", "-a", 1, "-a", 2]) assert ( "Error: The number of passed recipients is not the same as the passed amounts." -- GitLab