[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-backoffice] 01/03: testing /history
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-backoffice] 01/03: testing /history |
Date: |
Tue, 09 Jan 2018 13:25:17 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository backoffice.
commit b3d7a53245156cb35e320eee996a011ebb92746b
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Jan 9 13:12:04 2018 +0100
testing /history
---
talerbackoffice/backoffice/backoffice.py | 1 +
talerbackoffice/tests.py | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/talerbackoffice/backoffice/backoffice.py
b/talerbackoffice/backoffice/backoffice.py
index e59d0e6..b7d0e16 100644
--- a/talerbackoffice/backoffice/backoffice.py
+++ b/talerbackoffice/backoffice/backoffice.py
@@ -63,6 +63,7 @@ def index():
def javascript_licensing():
return flask.render_template("templates/javascript.html")
+
@app.route("/history")
def history():
qs = get_query_string().decode("utf-8")
diff --git a/talerbackoffice/tests.py b/talerbackoffice/tests.py
index 82269a1..20aeece 100644
--- a/talerbackoffice/tests.py
+++ b/talerbackoffice/tests.py
@@ -23,5 +23,15 @@ class BackofficeTestCase(unittest.TestCase):
soup.find("select").option.contents[0])
self.assertEqual(response.status_code, 200)
+ @patch("requests.get")
+ def test_history(self, mocked_get):
+ ret = MagicMock()
+ ret.status_code = 200
+ ret.json.return_value = {}
+ mocked_get.return_value = ret
+ self.app.get("/history?para1=1¶2=2")
+ mocked_get.assert_called_with(
+ "http://backend.example.com/history",
+ params=dict(para1='1', para2='2'))
if __name__ == "__main__":
unittest.main()
--
To stop receiving notification emails like this one, please contact
address@hidden