Splitting twisted test case into smaller CMD chunks.

This commit is contained in:
Marcello Stanisci 2018-06-25 14:41:07 +02:00
parent 886382236c
commit 6500fab93b
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F

View File

@ -140,7 +140,12 @@ run (void *cls,
struct TALER_TESTING_Interpreter *is) struct TALER_TESTING_Interpreter *is)
{ {
struct TALER_TESTING_Command commands[] = {
/**
* This batch aims to trigger the 409 Conflict
* response from a refresh-reveal operation.
*/
struct TALER_TESTING_Command refresh_409_conflict[] = {
CMD_TRANSFER_TO_EXCHANGE CMD_TRANSFER_TO_EXCHANGE
("refresh-create-reserve", ("refresh-create-reserve",
@ -198,14 +203,12 @@ run (void *cls,
"refresh-melt", "refresh-melt",
MHD_HTTP_CONFLICT), MHD_HTTP_CONFLICT),
/* Next chunk, refund conflicts TALER_TESTING_cmd_end ()
(contract hash missmatch [!], };
original deposit does not exist V,
currency missmatch) V;
struct TALER_TESTING_Command refund[] = {
'refund_transaction()' has many of the relevant cases;
*/
CMD_TRANSFER_TO_EXCHANGE CMD_TRANSFER_TO_EXCHANGE
("create-reserve-r1", ("create-reserve-r1",
@ -261,12 +264,9 @@ run (void *cls,
"EUR:0.01", "EUR:0.01",
"deposit-refund-1"), "deposit-refund-1"),
/* This deposit CMD is used to provide "good" traits /* This next deposit CMD is only used to provide a
* to the next refund CMD, where 'good' means that the * good merchant signature to the next (failing) refund
* POST /refund will pass the signature verification, * operations. */
* but the handler will then NOT judge the deposit as
* refundable - actually it won't be found since it will
* fail as double-spending attempt. */
TALER_TESTING_cmd_deposit TALER_TESTING_cmd_deposit
("deposit-refund-to-fail", ("deposit-refund-to-fail",
@ -307,6 +307,18 @@ run (void *cls,
"deposit-refund-1"), "deposit-refund-1"),
TALER_TESTING_cmd_end () TALER_TESTING_cmd_end ()
};
struct TALER_TESTING_Command commands[] = {
TALER_TESTING_cmd_batch ("refresh-reveal-409-conflict",
refresh_409_conflict),
TALER_TESTING_cmd_batch ("refund",
refund),
TALER_TESTING_cmd_end ()
}; };
TALER_TESTING_run_with_fakebank (is, TALER_TESTING_run_with_fakebank (is,