gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated: Moving #5366 chunk


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: Moving #5366 chunk into twisted tests, + fix it.
Date: Thu, 28 Jun 2018 16:23:06 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new e7eba2a  Moving #5366 chunk into twisted tests, + fix it.
e7eba2a is described below

commit e7eba2a0200fbc408df9c48a45cb1af432f59953
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Jun 28 16:22:24 2018 +0200

    Moving #5366 chunk into twisted tests, + fix it.
---
 src/lib/test_merchant_api_new.c     | 76 ---------------------------------
 src/lib/test_merchant_api_twisted.c | 83 +++++++++++++++++++++++++++++++++++++
 src/lib/testing_api_cmd_proposal.c  |  4 +-
 3 files changed, 85 insertions(+), 78 deletions(-)

diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index 898106f..17fcd5b 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -335,79 +335,6 @@ run (void *cls,
     TALER_TESTING_cmd_end ()
   };
 
-  /**
-   * This block tests whether a refund_deadline and/or
-   * wire_transfer_deadline very far in the future do NOT
-   * result in any wire transfer from the aggregator (#5366).
-   */
-  struct TALER_TESTING_Command unaggregation[] = {
-
-  #if HAVE_TALER_TALER_TWISTER_TESTING_LIB_H
-    CMD_TRANSFER_TO_EXCHANGE
-      ("create-reserve-unaggregation",
-       "EUR:5.01"),
-
-    CMD_EXEC_WIREWATCH
-      ("wirewatch-unaggregation"),
-
-    TALER_TESTING_cmd_check_bank_transfer
-      ("check_bank_transfer-unaggregation",
-       EXCHANGE_URL,
-       "EUR:5.01",
-       USER_ACCOUNT_NO,
-       EXCHANGE_ACCOUNT_NO),
-
-    TALER_TESTING_cmd_withdraw_amount
-      ("withdraw-coin-unaggregation",
-       is->exchange,
-       "create-reserve-unaggregation",
-       "EUR:5",
-       MHD_HTTP_OK),
-
-    TALER_TESTING_cmd_proposal
-      ("create-proposal-unaggregation",
-       merchant_url,
-       is->ctx,
-       MHD_HTTP_OK,
-       "{\"max_fee\":\
-          {\"currency\":\"EUR\",\
-           \"value\":0,\
-           \"fraction\":50000000},\
-        \"refund_deadline\":\"\\/Date(2)\\/\",\
-        \"pay_deadline\":\"\\/Date(1)\\/\",\
-        \"wire_transfer_delay\":\"\\/Delay(30000)\\/\",\
-        \"amount\":\
-          {\"currency\":\"EUR\",\
-           \"value\":5,\
-           \"fraction\":0},\
-        \"summary\": \"unaggregated product\",\
-        \"fulfillment_url\": \"https://example.com/\",\
-        \"products\": [ {\"description\":\"unaggregated cream\",\
-                         \"value\":\"{EUR:5}\"} ] }",
-        NULL),
-
-    TALER_TESTING_cmd_pay
-      ("pay-unaggregation",
-       merchant_url,
-       is->ctx,
-       MHD_HTTP_OK,
-       "create-proposal-unaggregation",
-       "withdraw-coin-unaggregation",
-       "EUR:5", // amount + fee
-       "EUR:4.99", // amount - fee
-       "EUR:0.01"), // refund fee
-
-    CMD_EXEC_AGGREGATOR
-      ("aggregation-attempt"),
-
-    TALER_TESTING_cmd_check_bank_empty
-      ("check_bank_unaggregated"),
-
-    #endif /* end of, HAVE_TWISTER */
-
-    TALER_TESTING_cmd_end ()
-  };
-
   struct TALER_TESTING_Command track[] = {
 
     TALER_TESTING_cmd_merchant_track_transaction
@@ -1123,9 +1050,6 @@ run (void *cls,
     TALER_TESTING_cmd_batch ("double-spending",
                              double_spending),
 
-    TALER_TESTING_cmd_batch ("unaggregation",
-                             unaggregation),
-
     TALER_TESTING_cmd_batch ("track",
                              track),
 
diff --git a/src/lib/test_merchant_api_twisted.c 
b/src/lib/test_merchant_api_twisted.c
index 61dda11..73c6a54 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -473,6 +473,83 @@ run (void *cls,
     TALER_TESTING_cmd_end ()
   };
 
+  /**
+   * This block tests whether a refund_deadline and/or
+   * wire_transfer_deadline very far in the future do NOT
+   * result in any wire transfer from the aggregator (#5366).
+   */
+  struct TALER_TESTING_Command unaggregation[] = {
+
+    CMD_TRANSFER_TO_EXCHANGE
+      ("create-reserve-unaggregation",
+       "EUR:5.01"),
+
+    CMD_EXEC_WIREWATCH
+      ("wirewatch-unaggregation"),
+
+    TALER_TESTING_cmd_check_bank_transfer
+      ("check_bank_transfer-unaggregation",
+       EXCHANGE_URL,
+       "EUR:5.01",
+       USER_ACCOUNT_NO,
+       EXCHANGE_ACCOUNT_NO),
+
+    TALER_TESTING_cmd_check_bank_empty
+      ("check_bank_unaggregated-a"),
+
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-unaggregation",
+       is->exchange,
+       "create-reserve-unaggregation",
+       "EUR:5",
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_proposal
+      ("create-proposal-unaggregation",
+       twister_merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "{\"max_fee\":\
+          {\"currency\":\"EUR\",\
+           \"value\":0,\
+           \"fraction\":50000000},\
+        \"refund_deadline\":\"\\/Date(2)\\/\",\
+        \"pay_deadline\":\"\\/Date(1)\\/\",\
+        \"wire_transfer_delay\":\"\\/Delay(30000)\\/\",\
+        \"amount\":\
+          {\"currency\":\"EUR\",\
+           \"value\":5,\
+           \"fraction\":0},\
+        \"summary\": \"unaggregated product\",\
+        \"fulfillment_url\": \"https://example.com/\",\
+        \"products\": [ {\"description\":\"unaggregated cream\",\
+                         \"value\":\"{EUR:5}\"} ] }",
+        /* Need a fresh instance in order to associate this
+         * proposal with a fresh h_wire;  this way, this proposal
+         * won't get hooked by the aggregator gathering same-H_wire'd
+         * transactions.  */
+        "tor"),
+
+    TALER_TESTING_cmd_pay
+      ("pay-unaggregation",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "create-proposal-unaggregation",
+       "withdraw-coin-unaggregation",
+       "EUR:5", // amount + fee
+       "EUR:4.99", // amount - fee
+       "EUR:0.01"), // refund fee
+
+    CMD_EXEC_AGGREGATOR
+      ("aggregation-attempt"),
+
+    TALER_TESTING_cmd_check_bank_empty
+      ("check_bank_unaggregated-b"),
+
+    TALER_TESTING_cmd_end ()
+  };
+
   /***** Test transactions tracking *****/
   struct TALER_TESTING_Command track[] = {
 
@@ -493,6 +570,9 @@ run (void *cls,
        EXCHANGE_URL,
        "EUR:2.02", USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO),
 
+    TALER_TESTING_cmd_check_bank_empty
+      ("track_chunk_check_empty-a"),
+
     TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-1",
                                        is->exchange,
                                        "create-reserve-1",
@@ -808,6 +888,9 @@ run (void *cls,
     TALER_TESTING_cmd_batch ("history",
                              history),
 
+    TALER_TESTING_cmd_batch ("unaggregation",
+                             unaggregation),
+
     TALER_TESTING_cmd_batch ("track",
                              track),
 
diff --git a/src/lib/testing_api_cmd_proposal.c 
b/src/lib/testing_api_cmd_proposal.c
index a558fa4..9a947d9 100644
--- a/src/lib/testing_api_cmd_proposal.c
+++ b/src/lib/testing_api_cmd_proposal.c
@@ -322,7 +322,7 @@ proposal_cb (void *cls,
        (ps->ctx,
         ps->merchant_url,
         ps->order_id,
-        "default",
+        ps->instance,
         &ps->nonce,
         &proposal_lookup_initial_cb,
         ps)))
@@ -493,7 +493,7 @@ TALER_TESTING_cmd_proposal (const char *label,
   ps->http_status = http_status;
   ps->ctx = ctx;
   ps->merchant_url = merchant_url;
-  ps->instance = instance;
+  ps->instance = (NULL == instance) ? "default": instance;
 
   cmd.cls = ps;
   cmd.label = label;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]