8000 Implement CheckRunOutput class · flepied/github3.py@49d00f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 49d00f3

Browse files
committed
Implement CheckRunOutput class
1 parent 58cde2c commit 49d00f3

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/github3/checks.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,22 @@ def check_runs(self):
245245
)
246246

247247

248+
class CheckRunOutput(models.GitHubCore):
249+
250+
class_name = "CheckRunOutput"
251+
CUSTOM_HEADERS = {"Accept": "application/vnd.github.antiope-preview+json"}
252+
253+
def _update_attributes(self, output):
254+
self.title = output["title"]
255+
self.summary = output["summary"]
256+
self.text = output["text"]
257+
self.annotations_count = output["annotations_count"]
258+
self.annotations_url = output["annotations_url"]
259+
260+
def _repr(self):
261+
return "<{s.class_name} [{s.title}]>".format(s=self)
262+
263+
248264
class CheckRun(models.GitHubCore):
249265
"""The :class:`CheckRun <CheckRun>` object.
250266
@@ -339,8 +355,7 @@ def _update_attributes(self, run):
339355
self.external_id = run["external_id"]
340356
self.app = CheckApp(run["app"], self)
341357
self.check_suite = run["check_suite"]["id"]
342-
# self.output = CheckRunOutput(run['output'], self)
343-
self.output = run["output"] # TODO: turn into an object
358+
self.output = CheckRunOutput(run["output"], self)
344359

345360
def _repr(self):
346361
return "<{s.class_name} [{s.name}:{s.status}]>".format(s=self)

0 commit comments

Comments
 (0)
0