Skip to content

Commit bcb8173

Browse files
committed
Merge pull request sigmavirus24#551 from itsmemattchung/tests/migrate-repos
Migrated update_label test to tests/{integration/unit}
2 parents 50a612e + b661c51 commit bcb8173

File tree

4 files changed

+3
-43
lines changed

4 files changed

+3
-43
lines changed

LATEST_VERSION_NOTES.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Breaking Changes (since 1.0.0a2)
1010

1111
- Move ``Users#delete_email_addresses`` to ``GitHub#delete_email_addresses``.
1212

13-
- Remove ``Users#add_email_address`` and ``Users#delete_eail_address``.
13+
- Remove ``Users#add_email_address`` and ``Users#delete_email_address``.
14+
15+
- Remove ``Repository#update_label``.
1416

1517
Features Added (since 1.0.0a2)
1618
``````````````````````````````

github3/repos/repo.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,22 +1916,6 @@ def tree(self, sha):
19161916
json = self._json(self._get(url), 200)
19171917
return self._instance_or_null(Tree, json)
19181918

1919-
@requires_auth
1920-
def update_label(self, name, color, new_name=''):
1921-
"""Update the label ``name``.
1922-
1923-
:param str name: (required), name of the label
1924-
:param str color: (required), color code
1925-
:param str new_name: (optional), new name of the label
1926-
:returns: bool
1927-
"""
1928-
label = self.label(name)
1929-
resp = False
1930-
if label:
1931-
upd = label.update
1932-
resp = upd(new_name, color) if new_name else upd(name, color)
1933-
return resp
1934-
19351919
def weekly_commit_count(self):
19361920
"""Retrieve the total commit counts.
19371921

tests/test_repos.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,6 @@ def setUp(self):
1818
def test_repr(self):
1919
assert repr(self.repo) == '<Repository [sigmavirus24/github3.py]>'
2020

21-
def test_update_label(self):
22-
self.response('label')
23-
self.patch(self.api + 'labels/Bug')
24-
self.conf = {'data': {'name': 'big_bug', 'color': 'fafafa'}}
25-
26-
self.assertRaises(github3.GitHubError, self.repo.update_label,
27-
'foo', 'bar')
28-
self.not_called()
29-
30-
self.login()
31-
with mock.patch.object(repos.Repository, 'label') as l:
32-
l.return_value = None
33-
assert self.repo.update_label('foo', 'bar') is False
34-
self.not_called()
35-
36-
with mock.patch.object(repos.Repository, 'label') as l:
37-
l.return_value = github3.issues.label.Label(load('label'), self.g)
38-
assert self.repo.update_label('big_bug', 'fafafa')
39-
40-
self.mock_assertions()
4121

4222
def test_equality(self):
4323
assert self.repo == repos.Repository(load('repo'))

tests/unit/test_repos_repo.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,9 +1452,3 @@ def test_teams(self):
14521452
"""Show that a user must be authenticated to list teams on a repo."""
14531453
with pytest.raises(GitHubError):
14541454
self.instance.teams()
1455-
1456-
def test_update_label(self):
1457-
"""
1458-
Show that a user must be authenticated to update a label on a repo.
1459-
"""
1460-
self.assert_requires_auth(self.instance.update_label)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy