Skip to content

Commit 85a1fce

Browse files
committed
create test fixture for postgres extension
1 parent 2b96be3 commit 85a1fce

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

testing/template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Resources:
100100
Action:
101101
- "s3:Get*"
102102
- "s3:List*"
103+
- "s3:Put*"
103104
Resource:
104105
- !Join ['', ['arn:aws:s3:::', !Ref Bucket]]
105106
- !Join ['', ['arn:aws:s3:::', !Ref Bucket, /*]]

testing/test_awswrangler/test_pandas.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ def postgres_parameters(cloudformation_outputs):
100100
postgres_parameters["Password"] = cloudformation_outputs.get("Password")
101101
else:
102102
raise Exception("You must deploy the test infrastructure using SAM!")
103+
conn = Aurora.generate_connection(database="postgres",
104+
host=postgres_parameters["PostgresAddress"],
105+
port=3306,
106+
user="test",
107+
password=postgres_parameters["Password"],
108+
engine="postgres")
109+
with conn.cursor() as cursor:
110+
sql = "CREATE EXTENSION IF NOT EXISTS aws_s3 CASCADE"
111+
cursor.execute(sql)
112+
conn.commit()
113+
conn.close()
103114
yield postgres_parameters
104115

105116

0 commit comments

Comments
 (0)