Skip to content

Commit

Permalink
Merge branch 'develop' into feature/161_handle_failure_if_branch_not_…
Browse files Browse the repository at this point in the history
…pushed
  • Loading branch information
aramnhammer committed Jun 7, 2020
2 parents 51cd086 + c3be852 commit 6682e6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tests/test_github_scm_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_github_scm_host_get_repos(mocker, scm_host_mock):
mocker.patch('zazu.github_helper.make_gh', return_value=github_mock)
scm_host_mock.connect()
repos = list(scm_host_mock.repos())
github_mock.get_user.assert_called_once_with('stopthatcow')
github_mock.get_user.assert_called_once_with()
user_mock.get_repos.assert_called_once()
assert len(repos) == 1
assert repos[0].name == 'zazu'
Expand All @@ -54,7 +54,6 @@ def test_from_config(git_repo):
with zazu.util.cd(git_repo.working_tree_dir):
uut = zazu.plugins.github_scm_host.ScmHost.from_config({'user': 'stopthatcow',
'type': 'github'})
assert uut._user == 'stopthatcow'
assert uut.type() == 'github'


Expand Down
3 changes: 1 addition & 2 deletions zazu/plugins/github_scm_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def __init__(self, user, url=None):
"""
self._github_handle = None
self._user = user
self._url = url

def connect(self):
Expand All @@ -38,7 +37,7 @@ def _github(self):
def repos(self):
"""List repos available to this user."""
try:
for r in self._github().get_user(self._user).get_repos():
for r in self._github().get_user().get_repos():
yield GitHubScmRepoAdaptor(r)
except github.GithubException as e:
raise zazu.scm_host.ScmHostError(str(e))
Expand Down

0 comments on commit 6682e6e

Please sign in to comment.