def test_validation_error_if_no_role_provided_when_manage_false(sample_app):
    # We're indicating that we should not be managing the
    # IAM role, but we're not giving a role ARN to use.
    # This is a validation error.
    config = Config.create(chalice_app=sample_app, manage_iam_role=False)
    with pytest.raises(ValueError):
        validate_configuration(config)
Beispiel #2
0
def test_validation_error_if_no_role_provided_when_manage_false(sample_app):
    # We're indicating that we should not be managing the
    # IAM role, but we're not giving a role ARN to use.
    # This is a validation error.
    config = Config.create(chalice_app=sample_app, manage_iam_role=False)
    with pytest.raises(ValueError):
        validate_configuration(config)
Beispiel #3
0
def test_trailing_slash_routes_result_in_error():
    app = Chalice('appname')
    app.routes = {'/trailing-slash/': None}
    config = {
        'chalice_app': app,
    }
    with pytest.raises(ValueError):
        validate_configuration(config)
Beispiel #4
0
def test_trailing_slash_routes_result_in_error():
    app = Chalice('appname')
    app.routes = {'/trailing-slash/': None}
    config = {
        'chalice_app':  app,
    }
    with pytest.raises(ValueError):
        validate_configuration(config)
Beispiel #5
0
def test_validation_error_if_no_role_provided_when_manage_false(sample_app):
    config = {
        'chalice_app': sample_app,
        'config': {
            # We're indicating that we should not be managing the
            # IAM role, but we're not giving a role ARN to use.
            # This is a validation error.
            'manage_iam_role': False,
        }
    }
    with pytest.raises(ValueError):
        validate_configuration(config)
Beispiel #6
0
def test_validation_error_if_no_role_provided_when_manage_false(sample_app):
    config = {
        'chalice_app': sample_app,
        'config': {
            # We're indicating that we should not be managing the
            # IAM role, but we're not giving a role ARN to use.
            # This is a validation error.
            'manage_iam_role': False,
        }
    }
    with pytest.raises(ValueError):
        validate_configuration(config)
Beispiel #7
0
def test_manage_iam_role_false_requires_role_arn(sample_app):
    config = {
        'chalice_app': sample_app,
        'config': {
            'manage_iam_role': False,
            'iam_role_arn': 'arn:::foo',
        }
    }
    assert validate_configuration(config) is None
Beispiel #8
0
def test_manage_iam_role_false_requires_role_arn(sample_app):
    config = {
        'chalice_app': sample_app,
        'config': {
            'manage_iam_role': False,
            'iam_role_arn': 'arn:::foo',
        }
    }
    assert validate_configuration(config) is None
def test_manage_iam_role_false_requires_role_arn(sample_app):
    config = Config.create(chalice_app=sample_app, manage_iam_role=False,
                           iam_role_arn='arn:::foo')
    assert validate_configuration(config) is None
Beispiel #10
0
def test_manage_iam_role_false_requires_role_arn(sample_app):
    config = Config.create(chalice_app=sample_app,
                           manage_iam_role=False,
                           iam_role_arn='arn:::foo')
    assert validate_configuration(config) is None