aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-03-23 12:07:42 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2018-03-23 12:07:42 +0100
commitff6fba5d6336ae0002b47cebbf56c5f9f3d0a2f9 (patch)
treed2b904d860b4b0ecfeb0f86b3c10775b50e7a8be
parentb97d4e7b475a0e637c24f3f3ea17d79f572d9067 (diff)
putting query with amounts under test.
-rw-r--r--src/include/taler_merchant_testing_lib.h14
-rw-r--r--src/lib/test_merchant_api_new.c8
-rw-r--r--src/lib/testing_api_cmd_tip.c35
3 files changed, 57 insertions, 0 deletions
diff --git a/src/include/taler_merchant_testing_lib.h b/src/include/taler_merchant_testing_lib.h
index 046fccb6..a242e6d8 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 a412fb66..2b8e75df 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 38a155b4..80722ba0 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,