@@ -96,10 +96,11 @@ def iam_client(boto3_session: Session, localstack: URL) -> BaseClient:
9696def s3_client (boto3_session : Session , localstack : URL ) -> BaseClient :
9797 return boto3_session .client ("s3" , endpoint_url = str (localstack ))
9898
99+
99100@pytest .fixture (scope = "session" )
100101def firehose_client (boto3_session : Session , localstack : URL ) -> BaseClient :
101- session = Session ( )
102- return session . client ( "firehose" , endpoint_url = str ( localstack ))
102+ return boto3_session . client ( "firehose" , endpoint_url = str ( localstack ) )
103+
103104
104105@pytest .fixture (scope = "session" )
105106def iam_role (iam_client : BaseClient ) -> Generator [str ]:
@@ -194,6 +195,7 @@ def flask_function(lambda_client: BaseClient, iam_role: str, lambda_zip: Path) -
194195 "Variables" : {
195196 "DYNAMODB_ENDPOINT" : os .getenv ("LOCALSTACK_INTERNAL_ENDPOINT" , "http://localstack:4566/" ),
196197 "S3_ENDPOINT" : os .getenv ("LOCALSTACK_INTERNAL_ENDPOINT" , "http://localstack:4566/" ),
198+ "FIREHOSE_ENDPOINT" : os .getenv ("LOCALSTACK_INTERNAL_ENDPOINT" , "http://localstack:4566/" ),
197199 "AWS_REGION" : AWS_REGION ,
198200 "LOG_LEVEL" : "DEBUG" ,
199201 }
@@ -382,13 +384,15 @@ def rules_bucket(s3_client: BaseClient) -> Generator[BucketName]:
382384 yield bucket_name
383385 s3_client .delete_bucket (Bucket = bucket_name )
384386
387+
385388@pytest .fixture (scope = "session" )
386389def audit_bucket (s3_client : BaseClient ) -> Generator [BucketName ]:
387390 bucket_name = BucketName (os .getenv ("AUDIT_BUCKET_NAME" , "test-audit-bucket" ))
388391 s3_client .create_bucket (Bucket = bucket_name , CreateBucketConfiguration = {"LocationConstraint" : AWS_REGION })
389392 yield bucket_name
390393 s3_client .delete_bucket (Bucket = bucket_name )
391394
395+
392396@pytest .fixture (scope = "class" )
393397def campaign_config (s3_client : BaseClient , rules_bucket : BucketName ) -> Generator [rules .CampaignConfig ]:
394398 campaign : rules .CampaignConfig = rule .CampaignConfigFactory .build (
@@ -419,8 +423,9 @@ def campaign_config(s3_client: BaseClient, rules_bucket: BucketName) -> Generato
419423
420424
421425@pytest .fixture (scope = "class" )
422- def campaign_config_with_magic_cohort (s3_client : BaseClient ,
423- rules_bucket : BucketName ) -> Generator [rules .CampaignConfig ]:
426+ def campaign_config_with_magic_cohort (
427+ s3_client : BaseClient , rules_bucket : BucketName
428+ ) -> Generator [rules .CampaignConfig ]:
424429 campaign : rules .CampaignConfig = rule .CampaignConfigFactory .build (
425430 target = "COVID" ,
426431 iterations = [
0 commit comments