コード例 #1
0
ファイル: __init__.py プロジェクト: jlmelville/passaas
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()
コード例 #2
0
ファイル: __init__.py プロジェクト: jlmelville/passaas
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()
コード例 #3
0
ファイル: __init__.py プロジェクト: jlmelville/passaas
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()
コード例 #4
0
ファイル: __init__.py プロジェクト: jlmelville/passaas
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()
コード例 #5
0
ファイル: __init__.py プロジェクト: jlmelville/passaas
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()
コード例 #6
0
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()
コード例 #7
0
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()
コード例 #8
0
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()
コード例 #9
0
    "--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)