@@ -96,6 +96,10 @@ 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+ @pytest .fixture (scope = "session" )
100+ def firehose_client (boto3_session : Session , localstack : URL ) -> BaseClient :
101+ session = Session ()
102+ return session .client ("firehose" , endpoint_url = str (localstack ))
99103
100104@pytest .fixture (scope = "session" )
101105def iam_role (iam_client : BaseClient ) -> Generator [str ]:
@@ -372,15 +376,21 @@ def persisted_person_pc_sw19(person_table: Any, faker: Faker) -> Generator[eligi
372376
373377
374378@pytest .fixture (scope = "session" )
375- def bucket (s3_client : BaseClient ) -> Generator [BucketName ]:
379+ def rules_bucket (s3_client : BaseClient ) -> Generator [BucketName ]:
376380 bucket_name = BucketName (os .getenv ("RULES_BUCKET_NAME" , "test-rules-bucket" ))
377381 s3_client .create_bucket (Bucket = bucket_name , CreateBucketConfiguration = {"LocationConstraint" : AWS_REGION })
378382 yield bucket_name
379383 s3_client .delete_bucket (Bucket = bucket_name )
380384
385+ @pytest .fixture (scope = "session" )
386+ def audit_bucket (s3_client : BaseClient ) -> Generator [BucketName ]:
387+ bucket_name = BucketName (os .getenv ("AUDIT_BUCKET_NAME" , "test-audit-bucket" ))
388+ s3_client .create_bucket (Bucket = bucket_name , CreateBucketConfiguration = {"LocationConstraint" : AWS_REGION })
389+ yield bucket_name
390+ s3_client .delete_bucket (Bucket = bucket_name )
381391
382392@pytest .fixture (scope = "class" )
383- def campaign_config (s3_client : BaseClient , bucket : BucketName ) -> Generator [rules .CampaignConfig ]:
393+ def campaign_config (s3_client : BaseClient , rules_bucket : BucketName ) -> Generator [rules .CampaignConfig ]:
384394 campaign : rules .CampaignConfig = rule .CampaignConfigFactory .build (
385395 target = "RSV" ,
386396 iterations = [
@@ -402,14 +412,15 @@ def campaign_config(s3_client: BaseClient, bucket: BucketName) -> Generator[rule
402412 )
403413 campaign_data = {"CampaignConfig" : campaign .model_dump (by_alias = True )}
404414 s3_client .put_object (
405- Bucket = bucket , Key = f"{ campaign .name } .json" , Body = json .dumps (campaign_data ), ContentType = "application/json"
415+ Bucket = rules_bucket , Key = f"{ campaign .name } .json" , Body = json .dumps (campaign_data ), ContentType = "application/json"
406416 )
407417 yield campaign
408- s3_client .delete_object (Bucket = bucket , Key = f"{ campaign .name } .json" )
418+ s3_client .delete_object (Bucket = rules_bucket , Key = f"{ campaign .name } .json" )
409419
410420
411421@pytest .fixture (scope = "class" )
412- def campaign_config_with_magic_cohort (s3_client : BaseClient , bucket : BucketName ) -> Generator [rules .CampaignConfig ]:
422+ def campaign_config_with_magic_cohort (s3_client : BaseClient ,
423+ rules_bucket : BucketName ) -> Generator [rules .CampaignConfig ]:
413424 campaign : rules .CampaignConfig = rule .CampaignConfigFactory .build (
414425 target = "COVID" ,
415426 iterations = [
@@ -424,15 +435,15 @@ def campaign_config_with_magic_cohort(s3_client: BaseClient, bucket: BucketName)
424435 )
425436 campaign_data = {"CampaignConfig" : campaign .model_dump (by_alias = True )}
426437 s3_client .put_object (
427- Bucket = bucket , Key = f"{ campaign .name } .json" , Body = json .dumps (campaign_data ), ContentType = "application/json"
438+ Bucket = rules_bucket , Key = f"{ campaign .name } .json" , Body = json .dumps (campaign_data ), ContentType = "application/json"
428439 )
429440 yield campaign
430- s3_client .delete_object (Bucket = bucket , Key = f"{ campaign .name } .json" )
441+ s3_client .delete_object (Bucket = rules_bucket , Key = f"{ campaign .name } .json" )
431442
432443
433444@pytest .fixture (scope = "class" )
434445def campaign_config_with_missing_descriptions_missing_rule_text (
435- s3_client : BaseClient , bucket : BucketName
446+ s3_client : BaseClient , rules_bucket : BucketName
436447) -> Generator [rules .CampaignConfig ]:
437448 campaign : rules .CampaignConfig = rule .CampaignConfigFactory .build (
438449 target = "FLU" ,
@@ -456,7 +467,7 @@ def campaign_config_with_missing_descriptions_missing_rule_text(
456467 )
457468 campaign_data = {"CampaignConfig" : campaign .model_dump (by_alias = True )}
458469 s3_client .put_object (
459- Bucket = bucket , Key = f"{ campaign .name } .json" , Body = json .dumps (campaign_data ), ContentType = "application/json"
470+ Bucket = rules_bucket , Key = f"{ campaign .name } .json" , Body = json .dumps (campaign_data ), ContentType = "application/json"
460471 )
461472 yield campaign
462- s3_client .delete_object (Bucket = bucket , Key = f"{ campaign .name } .json" )
473+ s3_client .delete_object (Bucket = rules_bucket , Key = f"{ campaign .name } .json" )
0 commit comments