gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 02/12: putting tip-authorize into tests.


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 02/12: putting tip-authorize into tests.
Date: Mon, 26 Mar 2018 10:37:56 +0200

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

marcello pushed a commit to branch master
in repository merchant.

commit 2bf5a099d305a03952ee53f28fca3d44046a06d2
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Mar 23 11:50:46 2018 +0100

    putting tip-authorize into tests.
---
 src/include/taler_merchant_testing_lib.h | 37 ++++++++++++++++++++++++++++++++
 src/lib/test_merchant_api_new.c          | 25 +++++++++++++++++++++
 src/lib/testing_api_cmd_tip.c            |  2 ++
 3 files changed, 64 insertions(+)

diff --git a/src/include/taler_merchant_testing_lib.h 
b/src/include/taler_merchant_testing_lib.h
index c487edb..046fccb 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -497,4 +497,41 @@ TALER_TESTING_get_trait_refund_entry
    unsigned int index,
    const struct TALER_MERCHANT_RefundEntry **refund_entry);
 
+/**
+ * FIXME
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_tip_authorize (const char *label,
+                                 const char *merchant_url,
+                                 const char *exchange_url,
+                                 struct GNUNET_CURL_Context *ctx,
+                                 unsigned int http_status,
+                                 const char *instance,
+                                 const char *justification,
+                                 const char *amount);
+
+/**
+ * FIXME
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_tip_query (const char *label,
+                             const char *merchant_url,
+                             struct GNUNET_CURL_Context *ctx,
+                             unsigned int http_status,
+                             const char *instance);
+
+/**
+ * FIXME
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_tip_pickup
+  (const char *label,
+   const char *merchant_url,
+   struct GNUNET_CURL_Context *ctx,
+   unsigned int http_status,
+   const char *authorize_reference,
+   const char **amounts,
+   struct TALER_EXCHANGE_Handle *exchange);
+
+
 #endif
diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index 2b34c54..9ca5b04 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -464,7 +464,32 @@ run (void *cls,
                                      "1"),
 
     /* Test tipping.  */
+    TALER_TESTING_cmd_fakebank_transfer_with_instance
+      ("create-reserve-tip-1",
+       "EUR:20.04",
+       fakebank_url,
+       USER_ACCOUNT_NO,
+       EXCHANGE_ACCOUNT_NO,
+       USER_LOGIN_NAME,
+       USER_LOGIN_PASS,
+       "tip",
+       EXCHANGE_URL,
+       CONFIG_FILE),
+
 
+    CMD_EXEC_WIREWATCH ("wirewatch-11"),
+
+    TALER_TESTING_cmd_tip_authorize ("authorize-tip-1",
+                                     merchant_url,
+                                     exchange_url,
+                                     is->ctx,
+                                     MHD_HTTP_OK,
+                                     "tip",
+                                     "tip 1",
+                                     "EUR:5.01"),
+    /* Will fail here until all new
+     * transfers have not been checked.  I.e.,
+     * there is now a 20.04 euro "pending" transfer.  */
 
     /* pay again logic.  */
     TALER_TESTING_cmd_fakebank_transfer
diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c
index 111180a..4284a41 100644
--- a/src/lib/testing_api_cmd_tip.c
+++ b/src/lib/testing_api_cmd_tip.c
@@ -258,6 +258,7 @@ tip_authorize_cleanup (void *cls,
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_tip_authorize (const char *label,
                                  const char *merchant_url,
+                                 const char *exchange_url,
                                  struct GNUNET_CURL_Context *ctx,
                                  unsigned int http_status,
                                  const char *instance,
@@ -269,6 +270,7 @@ TALER_TESTING_cmd_tip_authorize (const char *label,
 
   tas = GNUNET_new (struct TipAuthorizeState);
   tas->merchant_url = merchant_url;
+  tas->exchange_url = exchange_url;
   tas->ctx = ctx;
   tas->instance = instance;
   tas->justification = justification;

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



reply via email to

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