[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-backoffice] branch master updated (5b5173d -> 584339
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-backoffice] branch master updated (5b5173d -> 584339f) |
Date: |
Sat, 06 Jan 2018 12:46:38 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a change to branch master
in repository backoffice.
from 5b5173d fix switching between instances
new c65f735 include JavaScript in installed bundle
new 584339f test homepage shows the instances menu
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
Makefile.in | 5 +++--
setup.py | 5 ++++-
taler-merchant-backoffice.in | 1 -
talerbackoffice/helpers.py | 2 +-
talerbackoffice/tests.conf | 3 +++
talerbackoffice/tests.py | 10 ++++++++--
6 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 58f454d..730071d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -49,8 +49,9 @@ install: $(templates) install-data
.PHONY: check
check:
@export address@hidden@/talerbackoffice/tests.conf; \
- python3 setup.py test
+ export BACKOFFICE_BACKEND="http://backend.example.com/"; \
+ export BACKOFFICE_INSTANCES="MusicShop"; python3 setup.py nosetests -s
-.PHONY: pyliny
+.PHONY: pylint
pylint:
@pylint talerbackoffice/
diff --git a/setup.py b/setup.py
index cd82b8b..fc4a477 100755
--- a/setup.py
+++ b/setup.py
@@ -9,10 +9,13 @@ setup(name='talerbackoffice',
license='GPL',
packages=find_packages(),
install_requires=["Flask>=0.10"],
- tests_require=["nose", "mock"],
+ tests_require=["nose", "mock",
+ "beautifulsoup4"],
test_suite="nose.collector",
package_data={
'':[
+ "backoffice/static/*.js",
+ "backoffice/static/*.css",
"backoffice/templates/*.html",
"backoffice/static/web-common/*.png",
"backoffice/static/web-common/*.css",
diff --git a/taler-merchant-backoffice.in b/taler-merchant-backoffice.in
index 59108e6..0ea5097 100644
--- a/taler-merchant-backoffice.in
+++ b/taler-merchant-backoffice.in
@@ -39,7 +39,6 @@ def handle_serve_http(args):
"--env", "BACKOFFICE_INSTANCES=%s" % TC["backoffice-%s" %
args.frontend]["instances"].value_string(required=True))
def handle_serve_uwsgi(args):
- del args # pacify PEP checkers
serve_uwsgi = TC["backoffice-%s" %
args.frontend]["uwsgi_serve"].value_string(required=True).lower()
params = ["uwsgi", "uwsgi",
"--master",
diff --git a/talerbackoffice/helpers.py b/talerbackoffice/helpers.py
index 614e463..d574126 100644
--- a/talerbackoffice/helpers.py
+++ b/talerbackoffice/helpers.py
@@ -25,7 +25,7 @@ LOGGER = logging.getLogger(__name__)
TC = TalerConfig.from_env()
BACKEND_URL = TC["frontends"]["backend"].value_string(required=True)
-NDIGITS = TC["frontends"]["NDIGITS"].value_int()
+NDIGITS = 2
CURRENCY = TC["taler"]["CURRENCY"].value_string()
FRACTION_BASE = 1e8
diff --git a/talerbackoffice/tests.conf b/talerbackoffice/tests.conf
index 6043401..bd5e3cf 100644
--- a/talerbackoffice/tests.conf
+++ b/talerbackoffice/tests.conf
@@ -1,4 +1,7 @@
[taler]
CURRENCY = TESTKUDOS
+[frontends]
+BACKEND = http://backend.com/
+
# Need right values here for testing.
diff --git a/talerbackoffice/tests.py b/talerbackoffice/tests.py
index 6fa15cb..82269a1 100644
--- a/talerbackoffice/tests.py
+++ b/talerbackoffice/tests.py
@@ -4,6 +4,7 @@ import unittest
from mock import patch, MagicMock
from talerbackoffice.backoffice import backoffice
from talerbackoffice.talerconfig import TalerConfig
+from bs4 import BeautifulSoup
TC = TalerConfig.from_env()
CURRENCY = TC["taler"]["currency"].value_string(required=True)
@@ -12,9 +13,14 @@ class BackofficeTestCase(unittest.TestCase):
def setUp(self):
backoffice.app.testing = True
self.app = backoffice.app.test_client()
-
- def test_responsive(self):
+ # Check whether the homepage UI shows the instances
+ # in the drop-down menu. Instances are read from the
+ # environment.
+ def test_instances_are_shown(self):
response = self.app.get("/")
+ soup = BeautifulSoup(response.data, "html.parser")
+ self.assertEqual("MusicShop",
+ soup.find("select").option.contents[0])
self.assertEqual(response.status_code, 200)
if __name__ == "__main__":
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-backoffice] branch master updated (5b5173d -> 584339f),
gnunet <=