diff options
Diffstat (limited to 'src/testing/test_merchant_api.c')
-rw-r--r-- | src/testing/test_merchant_api.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index ed07bce6..3f9136bc 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -24,6 +24,7 @@ * @author Marcello Stanisci */ #include "platform.h" +#include <gnunet/gnunet_time_lib.h> #include <taler/taler_util.h> #include <taler/taler_signatures.h> #include <taler/taler_exchange_service.h> @@ -1656,6 +1657,55 @@ run (void *cls, TALER_TESTING_cmd_end () }; + struct TALER_TESTING_Command tokens[] = { + /** + * Move money to the exchange's bank account. + */ + cmd_transfer_to_exchange ("create-reserve-tokens", + "EUR:10.02"), + /** + * Make a reserve exist, according to the previous transfer. + */ + cmd_exec_wirewatch ("wirewatch-1"), + TALER_TESTING_cmd_check_bank_admin_transfer ("check_bank_transfer-tokens", + "EUR:10.02", + payer_payto, + exchange_payto, + "create-reserve-tokens"), + TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1", + "create-reserve-tokens", + "EUR:5", + 0, + MHD_HTTP_OK), + TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-2", + "create-reserve-tokens", + "EUR:5", + 0, + MHD_HTTP_OK), + TALER_TESTING_cmd_merchant_post_tokenfamilies ("create-tokenfamily", + merchant_url, + MHD_HTTP_NO_CONTENT, + "subscription-1", + "Subscription", + "A subscription.", + NULL, + GNUNET_TIME_timestamp_get (), + GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_YEARS), + GNUNET_TIME_UNIT_MONTHS, + "subscription"), + TALER_TESTING_cmd_merchant_post_orders_choices ("create-order-with-choices", + cred.cfg, + merchant_url, + MHD_HTTP_OK, + "create-tokenfamily", + "5-choices", + GNUNET_TIME_UNIT_ZERO_TS, + GNUNET_TIME_UNIT_FOREVER_TS, + "EUR:5.0"), + + TALER_TESTING_cmd_end () + }; + struct TALER_TESTING_Command commands[] = { /* general setup */ TALER_TESTING_cmd_run_fakebank ( @@ -1978,6 +2028,8 @@ run (void *cls, auth), TALER_TESTING_cmd_batch ("repurchase", repurchase), + TALER_TESTING_cmd_batch ("tokens", + tokens), /** * End the suite. */ |