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

update test_sams_proxy.py test_token_passthrough to use a session

parent 0a787753
No related branches found
No related tags found
1 merge request!24Resolve "API Token nur bei Einträgen in der Session zulassen"
......@@ -206,6 +206,7 @@ class TestSAMSHubWithThreadedAPI(unittest.TestCase):
for param_type in ('header', 'url', 'body'):
proxyApp = Flask('test')
proxyApp.config['TESTING'] = True
proxyApp.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
proxy = SAMSProxy(
proxySpec = {
'in': '/proxy', 'out': 'http://localhost:4711',
......@@ -223,6 +224,8 @@ class TestSAMSHubWithThreadedAPI(unittest.TestCase):
view_func = proxy.proxy, methods=['GET', 'POST', 'PUT', 'UPDATE',
'PATCH', 'DELETE', 'OPTIONS'])
with proxyApp.test_client(self) as client:
with client.session_transaction() as sess:
sess['user'] = 'foo'
res = client.get(path='/proxy/passthrough',
query_string={'u':'foo'}, data={'g':'bar'},
headers={'lang': 'klingon'})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment