Skip to content

Commit

Permalink
Merge pull request #12 from codecov/joseph/fix-parsed-raw-report-content
Browse files Browse the repository at this point in the history
Make sure toc exists in content before calling get_toc
  • Loading branch information
joseph-sentry authored Jul 16, 2023
2 parents 0bf5dc2 + 928d011 commit a48cafe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions services/report/parser/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ def size(self):

def content(self) -> BytesIO:
buffer = BytesIO()
for file in self.get_toc():
buffer.write(f"{file}\n".encode("utf-8"))
buffer.write("<<<<<< network\n\n".encode("utf-8"))
if self.has_toc():
for file in self.get_toc():
buffer.write(f"{file}\n".encode("utf-8"))
buffer.write("<<<<<< network\n\n".encode("utf-8"))
for file in self.uploaded_files:
buffer.write(f"# path={file.filename}\n".encode("utf-8"))
buffer.write(file.contents)
Expand Down

0 comments on commit a48cafe

Please sign in to comment.