Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/integration/publish/publish_app_integ_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ def setUpClass(cls):
cls.s3_bucket.create()

# Grant serverlessrepo read access to the bucket
bucket_policy_template = cls.test_data_path.joinpath("s3_bucket_policy.json").read_text()
bucket_policy_template = cls.test_data_path.joinpath("s3_bucket_policy.json").read_text(encoding="utf-8")
bucket_policy = bucket_policy_template.replace(cls.bucket_name_placeholder, cls.bucket_name)
cls.s3_bucket.Policy().put(Policy=bucket_policy)

# Upload test files to S3
root_path = Path(__file__).resolve().parents[3]
license_body = root_path.joinpath("LICENSE").read_text()
license_body = root_path.joinpath("LICENSE").read_text(encoding="utf-8")
cls.s3_bucket.put_object(Key="LICENSE", Body=license_body)

readme_body = root_path.joinpath("README.md").read_text()
readme_body = root_path.joinpath("README.md").read_text(encoding="utf-8")
cls.s3_bucket.put_object(Key="README.md", Body=readme_body)
cls.s3_bucket.put_object(Key="README_UPDATE.md", Body=readme_body)

code_body = cls.test_data_path.joinpath("main.py").read_text()
code_body = cls.test_data_path.joinpath("main.py").read_text(encoding="utf-8")
cls.s3_bucket.put_object(Key="main.py", Body=code_body)

@classmethod
Expand All @@ -61,7 +61,7 @@ def tearDownClass(cls):
def replace_template_placeholder(cls, placeholder, replace_text):
for f in cls.temp_dir.iterdir():
if f.suffix == ".yaml" or f.suffix == ".json":
content = f.read_text()
content = f.read_text(encoding="utf-8")
f.write_text(content.replace(placeholder, replace_text))

def setUp(self):
Expand Down