gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libeufin] branch master updated: no mock


From: gnunet
Subject: [GNUnet-SVN] [libeufin] branch master updated: no mock
Date: Thu, 03 Oct 2019 17:48:11 +0200

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

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new d025bc5  no mock
d025bc5 is described below

commit d025bc5b1ee362a152709f55485c4fd634babaa6
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Oct 3 17:48:06 2019 +0200

    no mock
---
 src/main/python/libeufin-cli | 35 +++++++++--------------------------
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/src/main/python/libeufin-cli b/src/main/python/libeufin-cli
index 5d0fc29..a22bf18 100755
--- a/src/main/python/libeufin-cli
+++ b/src/main/python/libeufin-cli
@@ -41,6 +41,7 @@ def customers(obj):
         resp = post(url, json=dict(name=name))
     except Exception:
         print("Could not reach the bank")
+        return
 
     # use the customer id contained in the response to
     # query for your details.
@@ -95,36 +96,18 @@ def customer_info(obj, customer_id):
     "--customer-id",
     help="id of the customer at the bank (used to pick keyset on disk)"
 )
-@click.option(
-    "--mock-info",
-    is_flag=True,
-    help="Mocks customer details instead of requesting ebics-info")
 @click.pass_obj
-def keyletter(obj, customer_id, mock_info):
+def keyletter(obj, customer_id):
 
-    if not mock_info and not customer_id:
-        print("Need --customer-id when not mocking ebics-info, aborting")
+    try:
+        url = urljoin(
+            obj["base_url"], "/admin/customers/{}".format(customer_id)
+        )
+        resp = get(url)
+    except Exception:
+        print("Could not connect to the bank, aborting")
         return
 
-    resp = MagicMock()
-    resp.status_code = 200
-    resp.json.return_value = dict(
-        name="Mock Name",
-        ebicsInfo=dict(userId="u1")
-    )
-
-    if mock_info:
-        print("Mocking ebics-info")
-    else:
-        try:
-            url = urljoin(
-                obj["base_url"], "/admin/customers/{}".format(customer_id)
-            )
-            resp = get(url)
-        except Exception:
-            print("Could not connect to the bank, aborting")
-            return
-
     assert(resp.status_code == 200)
     user_id = resp.json().get("ebicsInfo", {}).get("userId")
     name = resp.json().get("name")

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



reply via email to

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