gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated: test task deletion


From: gnunet
Subject: [libeufin] branch master updated: test task deletion
Date: Tue, 26 Jan 2021 18:40:24 +0100

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

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 6159e9f  test task deletion
6159e9f is described below

commit 6159e9fa673cc8b57362b26b6a6343f9cce8a066
Author: MS <ms@taler.net>
AuthorDate: Tue Jan 26 18:40:18 2021 +0100

    test task deletion
---
 integration-tests/tests.py | 57 ++++++++++++++++++++++++++++++++++++++++++++--
 integration-tests/util.py  | 17 +++++++++-----
 2 files changed, 66 insertions(+), 8 deletions(-)

diff --git a/integration-tests/tests.py b/integration-tests/tests.py
index dec1875..cbc281e 100755
--- a/integration-tests/tests.py
+++ b/integration-tests/tests.py
@@ -5,7 +5,7 @@ import pytest
 import json
 from deepdiff import DeepDiff as dd
 from subprocess import check_call
-from requests import post, get, auth
+from requests import post, get, auth, delete
 from time import sleep
 from util import (
     startNexus,
@@ -18,7 +18,8 @@ from util import (
     LibeufinPersona,
     BankingDetails,
     NexusDetails,
-    EbicsDetails
+    EbicsDetails,
+    compileLibeufin
 )
 
 # Database
@@ -116,6 +117,7 @@ def prepareNexus():
         )
     )
 
+compileLibeufin()
 dropSandboxTables()
 startSandbox()
 dropNexusTables()
@@ -513,3 +515,54 @@ def test_sandbox_camt():
             json=dict(iban="GB33BUKB20201555555555", type=53)
         )
     )
+
+def test_schedule_deletion():
+    assertResponse(
+        post("/".join([
+            PERSONA.nexus.base_url,
+            "bank-accounts",
+            PERSONA.nexus.bank_label,
+            "schedule"]),
+            json=dict(
+                name="test-task",
+                cronspec="* * *",
+                type="fetch",
+                params=dict(rangeType="all", level="all")),
+            auth=auth.HTTPBasicAuth("admin", "x")
+        )
+    )
+
+    resp = assertResponse(
+        get("/".join([
+            PERSONA.nexus.base_url,
+            "bank-accounts",
+            PERSONA.nexus.bank_label,
+            "schedule",
+            "test-task"]),
+            auth=auth.HTTPBasicAuth("admin", "x")
+        )
+    )
+    assert resp.json().get("taskName") == "test-task"
+
+    assertResponse(
+        delete("/".join([
+            PERSONA.nexus.base_url,
+            "bank-accounts",
+            PERSONA.nexus.bank_label,
+            "schedule",
+            "test-task"]),
+            auth=auth.HTTPBasicAuth("admin", "x")
+        )
+    )
+
+    resp = assertResponse(
+        get("/".join([
+            PERSONA.nexus.base_url,
+            "bank-accounts",
+            PERSONA.nexus.bank_label,
+            "schedule",
+            "test-task"]),
+            auth=auth.HTTPBasicAuth("admin", "x")
+        ),
+        acceptedResponses=[404]
+    )
diff --git a/integration-tests/util.py b/integration-tests/util.py
index 8230a3f..a05283c 100644
--- a/integration-tests/util.py
+++ b/integration-tests/util.py
@@ -121,6 +121,14 @@ def dropSandboxTables():
     ])
 
 
+def compileLibeufin():
+    check_call([
+        "../gradlew",
+        "-q", "--console=plain",
+        "-p", "..",
+        "assemble"
+    ])
+
 def dropNexusTables():
     check_call([
         "../gradlew",
@@ -130,9 +138,7 @@ def dropNexusTables():
         f"--args=reset-tables"
     ])
 
-
 def startSandbox():
-    check_call(["../gradlew", "-q", "--console=plain", "-p", "..", 
"sandbox:assemble"])
     checkPort(5000)
     sandbox = Popen([
         "../gradlew",
@@ -162,9 +168,6 @@ def startSandbox():
 
 
 def startNexus():
-    check_call(
-        ["../gradlew", "-q", "--console=plain", "-p", "..", "nexus:assemble",]
-    )
     checkPort(5001)
     nexus = Popen([
         "../gradlew",
@@ -194,7 +197,9 @@ def startNexus():
 
 def assertResponse(r, acceptedResponses=[200]):
     def http_trace(r):
-        request = f"{r.request.method} 
{r.request.url}\n{r.request.body.decode('utf-8')}"
+        request = f"{r.request.method} {r.request.url}"
+        if r.request.body:
+            request += f"\n{r.request.body.decode('utf-8')}"
         response = f"{r.status_code} {r.reason}\n{r.text}"
         return f"(the following communication 
failed)\n\n{request}\n\n{response}"
     assert r.status_code in acceptedResponses, http_trace(r)

-- 
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]