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
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
def dynamodb_localstack(localstack, dynamodb_tables): with b3f.Service("dynamodb", dynamodb_tables) as tables: yield tables
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
def sqs_localstack(localstack, sqs_queues): with b3f.Service("sqs", names=sqs_queues, redrive=True) as queues: yield queues
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
def kinesis_localstack(localstack, kinesis_streams): with b3f.Service("kinesis", kinesis_streams) as streams: yield streams
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
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
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")