Skip to content
Snippets Groups Projects
Commit 70b18f24 authored by Sebastian Lobinger's avatar Sebastian Lobinger
Browse files

update test_sams_app.py test_app_proxy_registered to reflect issue #27

parent 95ede555
No related branches found
No related tags found
1 merge request!19Resolve "Proxy muss alle HTTP-Methoden unterstützen"
......@@ -239,12 +239,19 @@ class TestSAMSAppWithThreadedApi(unittest.TestCase):
}
)
self.flaskApp.register_blueprint(testApp.blueprint)
thApp = FlaskInThread(self.flaskApp, host="localhost", port=5000)
thApp.start()
time.sleep(0.01)
with self.subTest('test flask url_map'):
self.assertGreater(len(list(self.flaskApp.url_map.iter_rules())), 1)
for path in ('/api/hello', '/api/'):
with self.subTest(path):
with self.flaskApp.test_client(self) as client:
response = client.get(path)
for method in ( 'GET', 'POST', 'DELETE', 'UPDATE', 'PATCH', 'OPTIONS',
'PUT', 'HEAD'):
with self.subTest('test path ' + path + ' method ' + method):
response = requests.request(method = method,
url = 'http://localhost:5000' + path)
self.assertIs(response.status_code, 200)
if __name__ == '__main__':
unittest.main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment