def empty_group_app(): """Application with an empty passwd file.""" _app = create_app(EmptyGroupConfig) ctx = _app.app.test_request_context() ctx.push() yield _app.app ctx.pop()
def malformed_group_bad_gid_app(): """Application with a bad gid group file.""" _app = create_app(MalformedGroupBadGidConfig) ctx = _app.app.test_request_context() ctx.push() yield _app.app ctx.pop()
def missing_group_app(): """Application with a missing group file.""" _app = create_app(MissingGroupConfig) ctx = _app.app.test_request_context() ctx.push() yield _app.app ctx.pop()
def malformed_group_too_many_elements_app(): """Application with a malformed group file with too many elements in a line.""" _app = create_app(MalformedGroupTooManyElementsConfig) ctx = _app.app.test_request_context() ctx.push() yield _app.app ctx.pop()
def malformed_group_too_few_elements_app(): """Application with a malformed group file that has too few elements in a line.""" _app = create_app(MalformedGroupTooFewElementsConfig) ctx = _app.app.test_request_context() ctx.push() yield _app.app ctx.pop()
def malformed_passwd_too_few_elements_app(): """Application with a malformed passwd file.""" _app = create_app(MalformedPasswdTooFewElementsConfig) ctx = _app.app.test_request_context() ctx.push() yield _app.app ctx.pop()
def missing_passwd_app(): """Application with a missing passwd file.""" _app = create_app(MissingPasswdConfig) ctx = _app.app.test_request_context() ctx.push() yield _app.app ctx.pop()
def malformed_passwd_bad_gid_app(): """Application with a bad gid passwd file.""" _app = create_app(MalformedPasswdBadGidConfig) ctx = _app.app.test_request_context() ctx.push() yield _app.app ctx.pop()
"--host", help="Hostname of the Flask app [default %s]" % DEFAULT_HOST, default=DEFAULT_HOST, ) parser.add_argument( "-P", "--port", help="Port for the Flask app [default %d]" % config.APP_PORT, default=config.APP_PORT, ) parser.add_argument( "-p", "--passwd", help="Path to passwd file [default %s]" % config.PASSWD_PATH, default=config.PASSWD_PATH, ) parser.add_argument( "-g", "--group", help="Path to group file [default %s]" % config.GROUP_PATH, default=config.GROUP_PATH, ) args = parser.parse_args() config.APP_PORT = int(args.port) config.PASSWD_PATH = args.passwd config.GROUP_PATH = args.group app = create_app(config) app.run(host=args.host, port=config.APP_PORT, debug=config.DEBUG)