Skip to content
Snippets Groups Projects
Commit 945a6fe0 authored by slobinger's avatar slobinger
Browse files

Merge branch '24-apppname-urlprefix-for-mainapp' into 'master'

Resolve "main app sollte auch unter /appname/,,, ereichbar sein"

Closes #24

See merge request !17
parents 710a8459 a74cc36c
No related branches found
No related tags found
1 merge request!17Resolve "main app sollte auch unter /appname/,,, ereichbar sein"
Pipeline #
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
......
......@@ -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):
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment