diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-05-18 16:54:36 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-05-18 16:54:36 +0200 |
commit | 5019bd69146824f3c6ec72e4dec1bb23dddf61ee (patch) | |
tree | 83f30ccaaa32f93efc6932388910b34b02fb74e1 /src/exchange-lib/test_exchange_api_new.c | |
parent | e746e0bbbc4439e07c1217c6f12110638a8ea565 (diff) | |
download | exchange-5019bd69146824f3c6ec72e4dec1bb23dddf61ee.tar.xz |
Ask to withdraw on a expired reserve.
Diffstat (limited to 'src/exchange-lib/test_exchange_api_new.c')
-rw-r--r-- | src/exchange-lib/test_exchange_api_new.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/exchange-lib/test_exchange_api_new.c b/src/exchange-lib/test_exchange_api_new.c index 0e4800002..75f5fe6a1 100644 --- a/src/exchange-lib/test_exchange_api_new.c +++ b/src/exchange-lib/test_exchange_api_new.c @@ -42,6 +42,8 @@ */ #define CONFIG_FILE "test_exchange_api.conf" +#define CONFIG_FILE_EXPIRE_RESERVE_NOW "test_exchange_api_expire_reserve_now.conf" + /** * Is the configuration file is set to include wire format 'ebics'? * Requires that EBICS /history function is implemented, which it @@ -639,6 +641,47 @@ run (void *cls, MHD_HTTP_OK), /** + * These commands should close the reserve because + * the aggregator is given a config file that ovverrides + * the reserve expiration time (making it now-ish) + */ + CMD_TRANSFER_TO_EXCHANGE + ("short-lived-reserve", + "EUR:5.01"), + + TALER_TESTING_cmd_exec_wirewatch + ("short-lived-aggregation", + CONFIG_FILE_EXPIRE_RESERVE_NOW), + + TALER_TESTING_cmd_exec_aggregator + ("close-reserves", + CONFIG_FILE_EXPIRE_RESERVE_NOW), + + TALER_TESTING_cmd_withdraw_amount + ("expired-withdraw", + is->exchange, + "short-lived-reserve", + "EUR:1", + MHD_HTTP_FORBIDDEN), + + /* Should also test a "insufficient funds" error + * after payback happened. */ + + TALER_TESTING_cmd_check_bank_transfer + ("check_bank_short-lived_transfer", + exchange_url, + "EUR:5.01", + 42, + 2), + + TALER_TESTING_cmd_check_bank_transfer + ("check_bank_short-lived_reimburse", + exchange_url, + "EUR:5", + 2, + 42), + + /** * Fill reserve with EUR:2.02, as withdraw fee is 1 ct per * config, then withdraw two coin, partially spend one, and * then have the rest paid back. Check deposit of other coin |