Skip to content

Commit

Permalink
Fix bitbucket test
Browse files Browse the repository at this point in the history
As @ryneeverett pointed out, `bitbucket.login` is a required setting so
we add it to the test fixture.

In addition, this commit update the bicbucket service to validate that a
`bitbucket.login` is present in the configuration.
  • Loading branch information
gdetrez committed Feb 21, 2016
1 parent ca19b58 commit a48f01c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 8 additions & 7 deletions bugwarrior/services/bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ def __init__(self, *args, **kw):
super(BitbucketService, self).__init__(*args, **kw)

self.auth = None
if self.config_get_default('login'):
login = self.config_get('login')
password = self.config_get_password(
'password',
self.get_keyring_service(self.config, self.target),
login)
login = self.config_get('login')
password = self.config_get_password(
'password',
self.get_keyring_service(self.config, self.target),
login)

self.auth = (login, password)
self.auth = (login, password)

self.exclude_repos = []
if self.config_get_default('exclude_repos', None):
Expand Down Expand Up @@ -136,6 +135,8 @@ def get_data(self, url, **kwargs):
def validate_config(cls, config, target):
if not config.has_option(target, 'bitbucket.username'):
die("[%s] has no 'username'" % target)
if not config.has_option(target, 'bitbucket.login'):
die("[%s] has no 'login'" % target)

IssueService.validate_config(config, target)

Expand Down
1 change: 1 addition & 0 deletions tests/test_bitbucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class TestBitbucketIssue(ServiceTest):
SERVICE_CONFIG = {
'bitbucket.login': 'something',
'bitbucket.username': 'somename',
'bitbucket.password': 'something else',
}

Expand Down

0 comments on commit a48f01c

Please sign in to comment.