gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 48/277: fix tests


From: gnunet
Subject: [taler-merchant] 48/277: fix tests
Date: Sun, 05 Jul 2020 20:49:21 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

commit 6548cc691d8c9fb443a46e12b10de922b6581f97
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Apr 24 20:32:10 2020 +0200

    fix tests
---
 src/backend/taler-merchant-httpd.c                        | 8 +++-----
 src/backend/taler-merchant-httpd_private-post-instances.c | 2 +-
 src/lib/merchant_api_delete_instance.c                    | 2 +-
 src/lib/merchant_api_delete_product.c                     | 2 +-
 src/lib/merchant_api_get_instance.c                       | 2 +-
 src/lib/merchant_api_get_instances.c                      | 2 +-
 src/lib/merchant_api_get_product.c                        | 2 +-
 src/lib/merchant_api_get_products.c                       | 2 +-
 src/lib/merchant_api_lock_product.c                       | 2 +-
 src/lib/merchant_api_patch_instance.c                     | 2 +-
 src/lib/merchant_api_patch_product.c                      | 2 +-
 src/lib/merchant_api_post_instances.c                     | 2 +-
 src/lib/merchant_api_post_products.c                      | 2 +-
 src/testing/testing_api_cmd_post_instances.c              | 7 ++++++-
 14 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c 
b/src/backend/taler-merchant-httpd.c
index 25c7bab..d5bcec6 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -832,11 +832,9 @@ url_handler (void *cls,
     }
   };
   static struct TMH_RequestHandler h404 = {
-    .mime_type = "text/html",
-    .data = "<html><title>404: not found</title>"
-            "<body>404: not found</body></html>",
-    .data_size = strlen ("<html><title>404: not found</title>"
-                         "<body>404: not found</body></html>"),
+    .mime_type = "application/json",
+    .data = "{\"code\":10}",
+    .data_size = strlen ("{\"code\":10}"),
     .handler = &TMH_MHD_handler_static_response,
     .response_code = MHD_HTTP_NOT_FOUND
   };
diff --git a/src/backend/taler-merchant-httpd_private-post-instances.c 
b/src/backend/taler-merchant-httpd_private-post-instances.c
index 75c5b2e..228cc3a 100644
--- a/src/backend/taler-merchant-httpd_private-post-instances.c
+++ b/src/backend/taler-merchant-httpd_private-post-instances.c
@@ -149,7 +149,7 @@ TMH_private_post_instances (const struct TMH_RequestHandler 
*rh,
   struct GNUNET_JSON_Specification spec[] = {
     GNUNET_JSON_spec_json ("payto_uris",
                            &payto_uris),
-    GNUNET_JSON_spec_string ("instance",
+    GNUNET_JSON_spec_string ("id",
                              &id),
     GNUNET_JSON_spec_string ("name",
                              &name),
diff --git a/src/lib/merchant_api_delete_instance.c 
b/src/lib/merchant_api_delete_instance.c
index 01852c4..edf73f8 100644
--- a/src/lib/merchant_api_delete_instance.c
+++ b/src/lib/merchant_api_delete_instance.c
@@ -139,7 +139,7 @@ instance_delete (struct GNUNET_CURL_Context *ctx,
     char *path;
 
     GNUNET_asprintf (&path,
-                     "instances/%s",
+                     "private/instances/%s",
                      instance_id);
     if (purge)
       idh->url = TALER_url_join (backend_url,
diff --git a/src/lib/merchant_api_delete_product.c 
b/src/lib/merchant_api_delete_product.c
index e406581..88607b4 100644
--- a/src/lib/merchant_api_delete_product.c
+++ b/src/lib/merchant_api_delete_product.c
@@ -144,7 +144,7 @@ TALER_MERCHANT_product_delete (
     char *path;
 
     GNUNET_asprintf (&path,
-                     "products/%s",
+                     "private/products/%s",
                      product_id);
     pdh->url = TALER_url_join (backend_url,
                                path,
diff --git a/src/lib/merchant_api_get_instance.c 
b/src/lib/merchant_api_get_instance.c
index 6499a6e..98e7f14 100644
--- a/src/lib/merchant_api_get_instance.c
+++ b/src/lib/merchant_api_get_instance.c
@@ -244,7 +244,7 @@ TALER_MERCHANT_instance_get (struct GNUNET_CURL_Context 
*ctx,
     char *path;
 
     GNUNET_asprintf (&path,
-                     "instances/%s",
+                     "private/instances/%s",
                      instance_id);
     igh->url = TALER_url_join (backend_url,
                                path,
diff --git a/src/lib/merchant_api_get_instances.c 
b/src/lib/merchant_api_get_instances.c
index 830e9b5..0ad33fa 100644
--- a/src/lib/merchant_api_get_instances.c
+++ b/src/lib/merchant_api_get_instances.c
@@ -249,7 +249,7 @@ TALER_MERCHANT_instances_get (struct GNUNET_CURL_Context 
*ctx,
   igh->cb = instances_cb;
   igh->cb_cls = instances_cb_cls;
   igh->url = TALER_url_join (backend_url,
-                             "instances",
+                             "private/instances",
                              NULL);
   if (NULL == igh->url)
   {
diff --git a/src/lib/merchant_api_get_product.c 
b/src/lib/merchant_api_get_product.c
index fc33ded..0388c79 100644
--- a/src/lib/merchant_api_get_product.c
+++ b/src/lib/merchant_api_get_product.c
@@ -212,7 +212,7 @@ TALER_MERCHANT_product_get (
     char *path;
 
     GNUNET_asprintf (&path,
-                     "products/%s",
+                     "private/products/%s",
                      product_id);
     pgh->url = TALER_url_join (backend_url,
                                path,
diff --git a/src/lib/merchant_api_get_products.c 
b/src/lib/merchant_api_get_products.c
index 86e93cd..c3edbde 100644
--- a/src/lib/merchant_api_get_products.c
+++ b/src/lib/merchant_api_get_products.c
@@ -222,7 +222,7 @@ TALER_MERCHANT_products_get (
   pgh->cb = cb;
   pgh->cb_cls = cb_cls;
   pgh->url = TALER_url_join (backend_url,
-                             "products",
+                             "private/products",
                              NULL);
   if (NULL == pgh->url)
   {
diff --git a/src/lib/merchant_api_lock_product.c 
b/src/lib/merchant_api_lock_product.c
index 9a83150..3b91d47 100644
--- a/src/lib/merchant_api_lock_product.c
+++ b/src/lib/merchant_api_lock_product.c
@@ -197,7 +197,7 @@ TALER_MERCHANT_product_lock (
     char *path;
 
     GNUNET_asprintf (&path,
-                     "products/%s/lock",
+                     "private/products/%s/lock",
                      product_id);
     plh->url = TALER_url_join (backend_url,
                                path,
diff --git a/src/lib/merchant_api_patch_instance.c 
b/src/lib/merchant_api_patch_instance.c
index 93f3b9f..f410235 100644
--- a/src/lib/merchant_api_patch_instance.c
+++ b/src/lib/merchant_api_patch_instance.c
@@ -243,7 +243,7 @@ TALER_MERCHANT_instance_patch (
     char *path;
 
     GNUNET_asprintf (&path,
-                     "instances/%s",
+                     "private/instances/%s",
                      instance_id);
     iph->url = TALER_url_join (backend_url,
                                path,
diff --git a/src/lib/merchant_api_patch_product.c 
b/src/lib/merchant_api_patch_product.c
index 9b0aead..4fba097 100644
--- a/src/lib/merchant_api_patch_product.c
+++ b/src/lib/merchant_api_patch_product.c
@@ -235,7 +235,7 @@ TALER_MERCHANT_product_patch (
     char *path;
 
     GNUNET_asprintf (&path,
-                     "products/%s",
+                     "private/products/%s",
                      product_id);
     pph->url = TALER_url_join (backend_url,
                                path,
diff --git a/src/lib/merchant_api_post_instances.c 
b/src/lib/merchant_api_post_instances.c
index 4548bc0..55a45e5 100644
--- a/src/lib/merchant_api_post_instances.c
+++ b/src/lib/merchant_api_post_instances.c
@@ -244,7 +244,7 @@ TALER_MERCHANT_instances_post (
   iph->cb = cb;
   iph->cb_cls = cb_cls;
   iph->url = TALER_url_join (backend_url,
-                             "/instances",
+                             "private/instances",
                              NULL);
   if (NULL == iph->url)
   {
diff --git a/src/lib/merchant_api_post_products.c 
b/src/lib/merchant_api_post_products.c
index 77cc859..7c3f57b 100644
--- a/src/lib/merchant_api_post_products.c
+++ b/src/lib/merchant_api_post_products.c
@@ -228,7 +228,7 @@ TALER_MERCHANT_products_post (
   pph->cb = cb;
   pph->cb_cls = cb_cls;
   pph->url = TALER_url_join (backend_url,
-                             "products",
+                             "private/products",
                              NULL);
   if (NULL == pph->url)
   {
diff --git a/src/testing/testing_api_cmd_post_instances.c 
b/src/testing/testing_api_cmd_post_instances.c
index 26efd0b..7162600 100644
--- a/src/testing/testing_api_cmd_post_instances.c
+++ b/src/testing/testing_api_cmd_post_instances.c
@@ -203,6 +203,7 @@ post_instances_cleanup (void *cls,
   }
   json_decref (pis->address);
   json_decref (pis->jurisdiction);
+  GNUNET_free (pis->payto_uris);
   GNUNET_free (pis);
 }
 
@@ -251,7 +252,11 @@ TALER_TESTING_cmd_merchant_post_instances2 (
   pis->instance_id = instance_id;
   pis->http_status = http_status;
   pis->payto_uris_length = payto_uris_length;
-  pis->payto_uris = payto_uris;
+  pis->payto_uris = GNUNET_new_array (payto_uris_length,
+                                      const char *);
+  memcpy (pis->payto_uris,
+          payto_uris,
+          sizeof (const char *) * payto_uris_length);
   pis->name = name;
   pis->address = address; /* ownership transfer! */
   pis->jurisdiction = jurisdiction; /* ownership transfer! */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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