gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-backoffice] 02/02: test homepage shows the instances


From: gnunet
Subject: [GNUnet-SVN] [taler-backoffice] 02/02: test homepage shows the instances menu
Date: Sat, 06 Jan 2018 12:46:40 +0100

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

marcello pushed a commit to branch master
in repository backoffice.

commit 584339f507bf94d3c9ff28f483a3e6acf94d408b
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Jan 6 12:46:14 2018 +0100

    test homepage shows the instances menu
---
 Makefile.in                |  5 +++--
 setup.py                   |  3 ++-
 talerbackoffice/helpers.py |  2 +-
 talerbackoffice/tests.conf |  3 +++
 talerbackoffice/tests.py   | 10 ++++++++--
 5 files changed, 17 insertions(+), 6 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 bd3c48a..fc4a477 100755
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,8 @@ 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={
           '':[
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



reply via email to

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