diff options
Diffstat (limited to 'src/testing/test_merchant_api.c')
-rw-r--r-- | src/testing/test_merchant_api.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 9759f417..1b7cba30 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -1293,6 +1293,78 @@ run (void *cls, TALER_TESTING_cmd_end () }; + struct TALER_TESTING_Command templates[] = { + TALER_TESTING_cmd_merchant_get_templates ("get-templates-empty", + merchant_url, + MHD_HTTP_OK, + NULL), + TALER_TESTING_cmd_merchant_post_templates ("post-templates-t1", + merchant_url, + "template-1", + "a template", + MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_merchant_post_templates ("post-templates-t1-idem", + merchant_url, + "template-1", + "a template", + MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_merchant_post_templates ("post-templates-t1-non-idem", + merchant_url, + "template-1", + "a different template", + MHD_HTTP_CONFLICT), + TALER_TESTING_cmd_merchant_get_templates ("get-templates-t1", + merchant_url, + MHD_HTTP_OK, + "post-templates-t1", + NULL), + TALER_TESTING_cmd_merchant_get_template ("get-template-t1", + merchant_url, + "template-1", + MHD_HTTP_OK, + "post-templates-t1"), + TALER_TESTING_cmd_merchant_post_templates ("post-templates-t2", + merchant_url, + "template-2", + "a template", + MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_merchant_patch_template ("patch-templates-t2", + merchant_url, + "template-2", + "another template", + "data:image/jpeg;base64,RAWDATA", + json_pack ("summary", + "EUR:1"), + MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_merchant_get_template ("get-template-t2", + merchant_url, + "template-2", + MHD_HTTP_OK, + "patch-templates-t2"), + TALER_TESTING_cmd_merchant_get_template ("get-template-nx", + merchant_url, + "template-nx", + MHD_HTTP_NOT_FOUND, + NULL), + TALER_TESTING_cmd_merchant_patch_template ("patch-templates-t3-nx", + merchant_url, + "template-3", + "nx updated template", + "data:image/jpeg;base64,RAWDATA", + json_pack ("summary", + "EUR:1"), + MHD_HTTP_NOT_FOUND), + TALER_TESTING_cmd_merchant_delete_template ("get-templates-empty", + merchant_url, + "t1", + MHD_HTTP_NOT_FOUND), + TALER_TESTING_cmd_merchant_delete_template ("get-templates-empty", + merchant_url, + "template-1", + MHD_HTTP_NO_CONTENT), + TALER_TESTING_cmd_end () + }; + struct TALER_TESTING_Command commands[] = { /* general setup */ TALER_TESTING_cmd_auditor_add ("add-auditor-OK", @@ -1643,6 +1715,8 @@ run (void *cls, tip), TALER_TESTING_cmd_batch ("auth", auth), + TALER_TESTING_cmd_batch ("templates", + templates), /** * End the suite. */ |