Exemplo n.º 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")
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)