Exemple #1
0
def lam(lambda_functions, environment):
    for lam in lambda_functions:
        lam["environment"] = {**environment(), **lam.get("environment", {})}

    with b3f.utils.set_env(environment()):
        with moto.mock_lambda():
            with b3f.Service("awslambda", lambda_functions):
                yield
Exemple #2
0
def dynamodb(dynamodb_tables, environment):
    with b3f.utils.set_env(environment()):
        with moto.mock_dynamodb2():
            with b3f.Service("dynamodb", dynamodb_tables) as tables:
                yield tables
Exemple #3
0
def dynamodb_localstack(localstack, dynamodb_tables):
    with b3f.Service("dynamodb", dynamodb_tables) as tables:
        yield tables
Exemple #4
0
def sqs(sqs_queues, environment):
    with b3f.utils.set_env(environment()):
        with moto.mock_sqs():
            with b3f.Service("sqs", names=sqs_queues, redrive=True) as queues:
                yield queues
Exemple #5
0
def sqs_localstack(localstack, sqs_queues):
    with b3f.Service("sqs", names=sqs_queues, redrive=True) as queues:
        yield queues
Exemple #6
0
def kinesis(kinesis_streams, environment):
    with b3f.utils.set_env(environment()):
        with moto.mock_kinesis():
            with b3f.Service("kinesis", kinesis_streams) as streams:
                yield streams
Exemple #7
0
def kinesis_localstack(localstack, kinesis_streams):
    with b3f.Service("kinesis", kinesis_streams) as streams:
        yield streams
Exemple #8
0
def lam_localstack(localstack, lambda_functions, environment):
    for lam in lambda_functions:
        lam["environment"] = {**environment(), **lam.get("environment", {})}

    with b3f.Service("awslambda", lambda_functions):
        yield
Exemple #9
0
def s3(s3_buckets, environment):
    with b3f.utils.set_env(environment()):
        with moto.mock_s3():
            with b3f.Service("s3", s3_buckets) as buckets:
                yield buckets
Exemple #10
0
def s3_localstack(localstack, s3_buckets):
    with b3f.Service("s3", s3_buckets) as buckets:
        yield buckets
def test_unsupported_service():
    with pytest.raises(boto3_fixtures.exceptions.UnsupportedServiceException):
        boto3_fixtures.Service("foobar")