gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant-frontends] branch master updated: testcase


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant-frontends] branch master updated: testcase infrastructure
Date: Fri, 28 Jul 2017 12:06:19 +0200

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

marcello pushed a commit to branch master
in repository merchant-frontends.

The following commit(s) were added to refs/heads/master by this push:
     new a345e0c  testcase infrastructure
a345e0c is described below

commit a345e0c15d356e55c66f3064cf0515de09a8d3bb
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Jul 28 12:05:57 2017 +0200

    testcase infrastructure
---
 Makefile.in                           |  5 +++++
 talerfrontends/donations/donations.py |  2 --
 talerfrontends/tests.conf             | 12 ++++++++++++
 talerfrontends/tests.py               | 23 +++++++++++++++++++++++
 4 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index d5c853b..2df8331 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -48,3 +48,8 @@ install: $(templates) install-data
        @# force update when sources changed
        @pip3 install . --install-option="address@hidden@" --upgrade --no-deps
        cd talerfrontends/donations/static/web-common && make install && cd -
+
+# run testcases
+.PHONY: check
+check:
+       @export TALER_CONFIG_FILE=./talerfrontends/tests.conf; python3 
./talerfrontends/tests.py
diff --git a/talerfrontends/donations/donations.py 
b/talerfrontends/donations/donations.py
index b98888a..8edf892 100644
--- a/talerfrontends/donations/donations.py
+++ b/talerfrontends/donations/donations.py
@@ -46,8 +46,6 @@ MAX_FEE = dict(value=3, fraction=0, currency=CURRENCY)
 
 app.config.from_object(__name__)
 
-print(app.config)
-
 @app.context_processor
 def utility_processor():
     def url(my_url):
diff --git a/talerfrontends/tests.conf b/talerfrontends/tests.conf
new file mode 100644
index 0000000..f37c9fd
--- /dev/null
+++ b/talerfrontends/tests.conf
@@ -0,0 +1,12 @@
+[taler]
+currency = TESTKUDOS
+
+[frontends]
+BACKEND = http://backend.test.taler.net/
+FRACTION = 100000000
+
+[donations]
+UWSGI_UNIXPATH_MODE = 660
+UWSGI_SERVE = unix
+UWSGI_UNIXPATH = $HOME/sockets/donations.uwsgi
+UWSGI_UNIXMODE = 666
diff --git a/talerfrontends/tests.py b/talerfrontends/tests.py
new file mode 100755
index 0000000..4a1a7d6
--- /dev/null
+++ b/talerfrontends/tests.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+"""
+Testing module, very limited: it is NOT able to mock
+a wallet (resume Python wallet?)!
+"""
+
+import unittest
+from donations import donations
+
+dapp = donations.app
+
+class DonationsTestCase(unittest.TestCase):
+    def setUp(self):
+        dapp.testing = True
+        self.app = dapp.test_client()
+
+    def test_root(self):
+        response = self.app.get("/") 
+        assert 200 == response.status_code
+
+if "__main__" == __name__:
+    unittest.main()

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



reply via email to

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