Klaus Demo ~jonashaag/klaus / 1d09a5c
Rename helper Jonas Haag 7 years ago
2 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
3232
3333 def options_test(make_app_args, expected_permissions):
3434 def test():
35 with testserver(**make_app_args):
35 with serve(**make_app_args):
3636 for action, permitted in expected_permissions.items():
3737 if action.endswith('auth'):
3838 actions = [action]
1717
1818
1919 @contextlib.contextmanager
20 def testserver(*args, **kwargs):
20 def serve(*args, **kwargs):
2121 app = klaus.make_app([TEST_REPO], TEST_SITE_NAME, *args, **kwargs)
2222 server = werkzeug.serving.make_server("localhost", 9876, app)
2323 thread = threading.Thread(target=server.serve_forever)
3131 time.sleep(1)
3232
3333
34 def testserver_require_auth(*args, **kwargs):
34 def serve_require_auth(*args, **kwargs):
3535 kwargs['htdigest_file'] = open(HTDIGEST_FILE)
3636 kwargs['require_browser_auth'] = True
3737 return testserver(*args, **kwargs)