How to use the bugwarrior.services.github.GithubService function in bugwarrior

To help you get started, we’ve selected a few bugwarrior examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ralphbean / bugwarrior / tests / test_github.py View on Github external
def setUp(self):
        self.config = RawConfigParser()
        self.config.interactive = False
        self.config.add_section('general')
        self.config.add_section('mygithub')
        self.config.set('mygithub', 'service', 'github')
        self.config.set('mygithub', 'github.login', 'tintin')
        self.config.set('mygithub', 'github.username', 'milou')
        self.config.set('mygithub', 'github.password', 't0ps3cr3t')
        self.service_config = ServiceConfig(
            GithubService.CONFIG_PREFIX, self.config, 'mygithub')
github ralphbean / bugwarrior / tests / test_github.py View on Github external
def test_default_host(self):
        """ Check that if github.host is not set, we default to github.com """
        service = GithubService(self.config, 'general', 'mygithub')
        self.assertEqual("github.com", service.host)
github ralphbean / bugwarrior / tests / test_github.py View on Github external
def test_overwrite_host(self):
        """ Check that if github.host is set, we use its value as host """
        self.config.set('mygithub', 'github.host', 'github.example.com')
        service = GithubService(self.config, 'general', 'mygithub')
        self.assertEqual("github.example.com", service.host)
github ralphbean / bugwarrior / tests / test_github.py View on Github external
def setUp(self):
        super(TestGithubIssueQuery, self).setUp()
        self.service = self.get_mock_service(GithubService)
github ralphbean / bugwarrior / tests / test_github.py View on Github external
def test_get_repository_from_issue_url__issue(self):
        issue = dict(repos_url="https://github.com/foo/bar")
        repository = GithubService.get_repository_from_issue(issue)
        self.assertEqual("foo/bar", repository)
github ralphbean / bugwarrior / tests / test_github.py View on Github external
def test_keyring_service(self):
        """ Checks that the keyring service name """
        keyring_service = GithubService.get_keyring_service(self.service_config)
        self.assertEqual("github://tintin@github.com/milou", keyring_service)
github ralphbean / bugwarrior / tests / test_github.py View on Github external
def test_token_authorization_header(self):
        self.config.remove_option('mygithub', 'github.password')
        self.config.set('mygithub', 'github.token',
                        '@oracle:eval:echo 1234567890ABCDEF')
        service = GithubService(self.config, 'general', 'mygithub')
        self.assertEqual(service.client.session.headers['Authorization'],
                         "token 1234567890ABCDEF")
github ralphbean / bugwarrior / bugwarrior / services / github.py View on Github external
def __init__(self, *args, **kw):
        super(GithubService, self).__init__(*args, **kw)
        self.ghc = github2.client.Github()