Beispiel #1
0
 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")
Beispiel #2
0
 def test_keyring_service_host(self):
     """ Checks that the keyring key depends on the github host. """
     self.config.set('mygithub', 'github.host', 'github.example.com')
     keyring_service = GithubService.get_keyring_service(
         self.service_config)
     self.assertEquals("github://[email protected]/milou",
                       keyring_service)
Beispiel #3
0
 def test_get_repository_from_issue__enterprise_github(self):
     issue = dict(repos_url="https://github.acme.biz/foo/bar")
     repository = GithubService.get_repository_from_issue(issue)
     self.assertEquals("foo/bar", repository)
Beispiel #4
0
 def test_get_repository_from_issue_url__pull_request(self):
     issue = dict(repos_url="https://github.com/foo/bar")
     repository = GithubService.get_repository_from_issue(issue)
     self.assertEquals("foo/bar", repository)
Beispiel #5
0
 def test_keyring_service(self):
     """ Checks that the keyring service name """
     keyring_service = GithubService.get_keyring_service(self.service_config)
     self.assertEquals("github://[email protected]/milou", keyring_service)
Beispiel #6
0
 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.assertEquals("github.example.com", service.host)
Beispiel #7
0
 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.assertEquals("github.com", service.host)
Beispiel #8
0
 def test_get_repository_from_issue__enterprise_github(self):
     issue = dict(repos_url="https://github.acme.biz/foo/bar")
     repository = GithubService.get_repository_from_issue(issue)
     self.assertEquals("foo/bar", repository)
Beispiel #9
0
 def test_get_repository_from_issue_url__pull_request(self):
     issue = dict(repos_url="https://github.com/foo/bar")
     repository = GithubService.get_repository_from_issue(issue)
     self.assertEquals("foo/bar", repository)
Beispiel #10
0
 def test_keyring_service_host(self):
     """ Checks that the keyring key depends on the github host. """
     self.config.set('mygithub', 'github.host', 'github.example.com')
     keyring_service = GithubService.get_keyring_service(self.service_config)
     self.assertEquals("github://[email protected]/milou", keyring_service)
Beispiel #11
0
 def test_keyring_service(self):
     """ Checks that the keyring service name """
     keyring_service = GithubService.get_keyring_service(self.service_config)
     self.assertEquals("github://[email protected]/milou", keyring_service)