Skip to content

Commit

Permalink
Implement get_annotations(). Try to fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kostajh committed Apr 4, 2014
1 parent 875bc4a commit cd95e1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions bugwarrior/services/activecollab.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ def to_taskwarrior(self):
)
return record

def get_annotations(self):
return self.extra.get('annotations', [])

def get_project(self):
project_id = self.record['permalink'].split('/')[4]
if (project_id.isdigit()):
Expand Down
6 changes: 5 additions & 1 deletion tests/test_activecollab.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestActiveCollabIssue(ServiceTest):

def setUp(self):
with mock.patch(
'bugwarrior.services.activecollab.ActiveCollabClient.call_api'
'pyac.library.activeCollab.call_api'
):
self.service = self.get_mock_service(ActiveCollabService)

Expand All @@ -31,6 +31,9 @@ def test_to_taskwarrior(self):
arbitrary_created_on = (
datetime.datetime.now() - datetime.timedelta(hours=2)
)
arbitrary_extra = {
'annotations': ['an annotation'],
}
arbitrary_issue = {
'project': 'something',
'due_on': arbitrary_due_on.isoformat(),
Expand All @@ -54,6 +57,7 @@ def test_to_taskwarrior(self):
'project': arbitrary_issue['project'],
'due': arbitrary_due_on.isoformat(),
'priority': 'M',
'annotations': arbitrary_extra['annotations'],
issue.PERMALINK: arbitrary_issue['permalink'],
issue.PROJECT_ID: arbitrary_issue['project_id'],
issue.TYPE: arbitrary_issue['type'],
Expand Down

0 comments on commit cd95e1d

Please sign in to comment.