Coverage for /home/delusionalinsanity/bbrepos/matyan/src/matyan/fetchers/jira.py: 56%

# Coverage for /home/delusionalinsanity/bbrepos/matyan/src/matyan/fetchers/jira.py : 56%

## 25 statements 14 run 11 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | import logging from typing import Dict from atlassian import Jira from .base import BaseFetcher LOGGER = logging.getLogger(__name__) __author__ = 'Artur Barseghyan' __copyright__ = '2019 Artur Barseghyan' __license__ = 'GPL-2.0-only OR LGPL-2.0-or-later' __all__ = ( 'BaseFetcher', 'JiraFetcher', ) class JiraFetcher(BaseFetcher): uid: str = 'Jira' instance: Jira def get_instance(self) -> Jira: config = self.get_config() return Jira( url=config["url"], username=config["username"], password=config["token"] ) def fetch_issue_data(self, issue_id: str) -> Dict[str, str]: if not self.should_continue(): LOGGER.debug("Skip after number of retries reached") return {} try: issue = self.instance.issue(issue_id) return { 'title': issue['fields']['summary'], 'description': issue['fields']['description'], } except (TypeError, KeyError, IOError) as err: self.register_error() return {}