Skip to content

Commit 392f68b

Browse files
committed
Cleanup use of (app) auth required decorator
1 parent 44365c3 commit 392f68b

File tree

4 files changed

+2
-24
lines changed

4 files changed

+2
-24
lines changed

src/github3/checks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ def _update_attributes(self, suite):
216216
def _repr(self):
217217
return "<{s.class_name} [{s.id}:{s.status}]>".format(s=self)
218218

219+
@decorators.requires_auth
219220
def rerequest(self):
220221
"""Rerequest the check suite.
221222

src/github3/repos/commit.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import unicode_literals
44

55
from . import status
6-
from .. import checks, git, models, users, decorators
6+
from .. import checks, git, models, users
77
from .comment import RepoComment
88

99

@@ -36,7 +36,6 @@ def _update_attributes(self, commit):
3636
def _repr(self):
3737
return "<{0} [{1}]>".format(self.class_name, self.sha[:7])
3838

39-
@decorators.requires_app_installation_auth
4039
def check_runs(self):
4140
"""Retrieve the check runs for this commit.
4241
@@ -52,7 +51,6 @@ def check_runs(self):
5251
-1, url, checks.CheckRun, headers=checks.CheckRun.CUSTOM_HEADERS
5352
)
5453

55-
@decorators.requires_app_installation_auth
5654
def check_suites(self):
5755
"""Retrieve the check suites for this commit.
5856

src/github3/repos/repo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ def branches(self, number=-1, protected=False, etag=None):
263263
headers=branch.Branch.PREVIEW_HEADERS,
264264
)
265265

266-
@decorators.requires_app_installation_auth
267266
def check_run(self, id):
268267
"""Return a single check run.
269268
@@ -284,7 +283,6 @@ def check_run(self, id):
284283
)
285284
return self._instance_or_null(checks.CheckRun, data)
286285

287-
@decorators.requires_app_installation_auth
288286
def check_suite(self, id):
289287
"""Return a single check suite.
290288

tests/unit/test_repos_commit.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""Unit tests for Repository Commits."""
22
import github3
3-
import pytest
4-
5-
from github3.exceptions import GitHubException
63

74
from . import helper
85

@@ -66,19 +63,3 @@ def test_check_suits(self):
6663
params={"per_page": 100},
6764
headers=github3.checks.CheckSuite.CUSTOM_HEADERS,
6865
)
69-
70-
71-
class TestRepoCommitRequiresAuth(helper.UnitRequiresAuthenticationHelper):
72-
73-
"""Unit test for auth required Repository Commit methods."""
74-
75-
described_class = github3.repos.commit.RepoCommit
76-
example_data = example_commit_data
77-
78-
def test_check_runs(self):
79-
with pytest.raises(GitHubException):
80-
self.instance.check_runs()
81-
82-
def test_check_suites(self):
83-
with pytest.raises(GitHubException):
84-
self.instance.check_suites()

0 commit comments

Comments
 (0)