diff --git a/debian/changelog b/debian/changelog index b8f489efaa1dcaaccefa776b9bc14d790ee5febb..c5bce69bfd17101e4eed90ab90d51cd6028b59b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,11 @@ -python3-sams-classes (1.0.1~2) UNRELEASED; urgency=medium +python3-sams-classes (1.0.1~3) UNRELEASED; urgency=medium * fixed issue #20 "Basis-Pfad (/) bei API über Proxy nicht aufrufbar" * fixed issue #21 "Unterstützung von anderen HTTP-Methoden als GET innerhalb einer APP" + * Fixed issue #24 "main app sollte auch unter /appname/,,, ereichbar sein" - -- Sebastian Lobinger <sebastian.lobinger@zib.de> Wed, 14 Jun 2017 08:36:02 +0200 + -- Sebastian Lobinger <slobinger@justus.zib.de> Wed, 14 Jun 2017 14:29:26 +0200 python3-sams-classes (1.0.0) unstable; urgency=medium diff --git a/sams_classes/sams_hub.py b/sams_classes/sams_hub.py index 9d6d91be156659381dc6a86fae0fd03a128ade66..de08fbdcb7d30fa68d9a4c71597c1b8215c73af6 100644 --- a/sams_classes/sams_hub.py +++ b/sams_classes/sams_hub.py @@ -37,9 +37,8 @@ class SAMSHub: self._appList.append(app) if app.name == self._config.get('main_app'): self._flaskApp.register_blueprint(app.blueprint) - else: - self._flaskApp.register_blueprint( - app.blueprint, url_prefix = '/' + app.name) + self._flaskApp.register_blueprint( + app.blueprint, url_prefix = '/' + app.name) @property def appKeys(self): diff --git a/test/test_sams_hub.py b/test/test_sams_hub.py index 987e39438813bc91cc59781b0e38fd121d19b21a..35d50c8b74a03d6c80b9b3f223f3624c6a0c280e 100644 --- a/test/test_sams_hub.py +++ b/test/test_sams_hub.py @@ -100,13 +100,16 @@ class CaseSAMSHubWithMainApp(unittest.TestCase): ) hub.flaskApp.config['DEBUG'] = True with hub.flaskApp.test_client(self) as client: - response = client.get('/') - self.assertIs(response.status_code, 200) - self.assertEquals(response.data.decode('utf-8'), expected) - response = client.get('/' + urls[1]) - self.assertIs(response.status_code, 200) - response = client.get('/' + extra_app + '/' + urls[2]) - self.assertIs(response.status_code, 200) + for path in ('/', '/' + main_app + '/'): + with self.subTest('check rootpath with content for ' + path): + response = client.get(path) + self.assertIs(response.status_code, 200) + self.assertEquals(response.data.decode('utf-8'), expected) + for path in ('/' + urls[1], '/' + main_app + '/' + urls[1], + '/' + extra_app + '/' + urls[2]): + with self.subTest('check status_code for ' + path): + response = client.get(path) + self.assertIs(response.status_code, 200) class CaseSAMSHubInitExceptions(unittest.TestCase):