Skip to content

Commit

Permalink
Fix erroneous json encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhammerl committed Oct 20, 2023
1 parent 230174c commit 5d40914
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion steps/transform/src/handler/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def transform_report(event, context):
result = s3.put_object(
Bucket=website_bucket,
Key="index.html",
Body=json.dumps(page).encode(),
Body=page.encode(),
)


Expand Down
3 changes: 1 addition & 2 deletions steps/transform/test/unit/handler/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def test_should_transform_report_to_html():
transform_report(context=None, event=None)

result = s3.get_object(Bucket=WEBSITE_BUCKET, Key=f"index.html")
text = result["Body"].read().decode()
html_from_s3 = json.loads(text)
html_from_s3 = result["Body"].read().decode()

html_from_fixture = read_fixture(filename="index.html")

Expand Down

0 comments on commit 5d40914

Please sign in to comment.