gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 05/12: putting query with amounts under te


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 05/12: putting query with amounts under test.
Date: Mon, 26 Mar 2018 10:37:59 +0200

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

marcello pushed a commit to branch master
in repository merchant.

commit ff6fba5d6336ae0002b47cebbf56c5f9f3d0a2f9
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Mar 23 12:07:42 2018 +0100

    putting query with amounts under test.
---
 src/include/taler_merchant_testing_lib.h | 14 +++++++++++++
 src/lib/test_merchant_api_new.c          |  8 ++++++++
 src/lib/testing_api_cmd_tip.c            | 35 ++++++++++++++++++++++++++++++++
 3 files changed, 57 insertions(+)

diff --git a/src/include/taler_merchant_testing_lib.h 
b/src/include/taler_merchant_testing_lib.h
index 046fccb..a242e6d 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -524,6 +524,20 @@ TALER_TESTING_cmd_tip_query (const char *label,
  * FIXME
  */
 struct TALER_TESTING_Command
+TALER_TESTING_cmd_tip_query_with_amounts
+  (const char *label,
+   const char *merchant_url,
+   struct GNUNET_CURL_Context *ctx,
+   unsigned int http_status,
+   const char *instance,
+   const char *expected_amount_picked_up,
+   const char *expected_amount_authorized,
+   const char *expected_amount_available);
+
+/**
+ * FIXME
+ */
+struct TALER_TESTING_Command
 TALER_TESTING_cmd_tip_pickup
   (const char *label,
    const char *merchant_url,
diff --git a/src/lib/test_merchant_api_new.c b/src/lib/test_merchant_api_new.c
index a412fb6..2b8e75d 100644
--- a/src/lib/test_merchant_api_new.c
+++ b/src/lib/test_merchant_api_new.c
@@ -503,6 +503,14 @@ run (void *cls,
                                  MHD_HTTP_OK,
                                  "tip"),
 
+    TALER_TESTING_cmd_tip_query_with_amounts ("query-1",
+                                              merchant_url,
+                                              is->ctx,
+                                              MHD_HTTP_OK,
+                                              "tip",
+                                              "EUR:0.0", // picked
+                                              "EUR:10.02", // auth
+                                              "EUR:20.04"),// ava
     /* Will fail here until all new
      * transfers have not been checked.  I.e.,
      * there is now a 20.04 euro "pending" transfer.  */
diff --git a/src/lib/testing_api_cmd_tip.c b/src/lib/testing_api_cmd_tip.c
index 38a155b..80722ba 100644
--- a/src/lib/testing_api_cmd_tip.c
+++ b/src/lib/testing_api_cmd_tip.c
@@ -399,6 +399,41 @@ tip_query_run (void *cls,
  * FIXME
  */
 struct TALER_TESTING_Command
+TALER_TESTING_cmd_tip_query_with_amounts
+  (const char *label,
+   const char *merchant_url,
+   struct GNUNET_CURL_Context *ctx,
+   unsigned int http_status,
+   const char *instance,
+   const char *expected_amount_picked_up,
+   const char *expected_amount_authorized,
+   const char *expected_amount_available)
+{
+  struct TipQueryState *tqs;
+  struct TALER_TESTING_Command cmd;
+
+  tqs = GNUNET_new (struct TipQueryState);
+  tqs->merchant_url = merchant_url;
+  tqs->ctx = ctx;
+  tqs->instance = instance;
+  tqs->http_status = http_status;
+  tqs->expected_amount_picked_up = expected_amount_picked_up;
+  tqs->expected_amount_authorized = expected_amount_authorized;
+  tqs->expected_amount_available = expected_amount_available;
+
+  cmd.cls = tqs;
+  cmd.label = label;
+  cmd.run = &tip_query_run;
+  cmd.cleanup = &tip_query_cleanup;
+  
+  return cmd;
+}
+
+
+/**
+ * FIXME
+ */
+struct TALER_TESTING_Command
 TALER_TESTING_cmd_tip_query (const char *label,
                              const char *merchant_url,
                              struct GNUNET_CURL_Context *ctx,

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



reply via email to

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