Skip to content

Commit

Permalink
fix: encoding on files read for publish integ tests (#1264)
Browse files Browse the repository at this point in the history
  • Loading branch information
sriram-mv authored Jul 10, 2019
1 parent bbb9e13 commit 3e24678
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 3e24678

Please sign in to comment.