Ejemplo n.º 1
0
 def test_authenticate_cached_credentials_pass(self):
     self.github.config.user_login = '******'
     self.github.config.user_pass = '******'
     self.github.config.save_config()
     self.github.config.user_login = ''
     self.github.config.user_pass = ''
     self.github.config.api = None
     config = self.github.config.get_github_config_path(
         self.github.config.CONFIG)
     parser = configparser.RawConfigParser()
     self.github.config.authenticate_cached_credentials(config, parser)
     assert self.github.config.user_login == 'foo'
     assert self.github.config.user_pass is None
Ejemplo n.º 2
0
 def test_authenticate_cached_credentials_pass_enterprise(self):
     self.github.config.user_login = '******'
     self.github.config.user_pass = '******'
     self.github.config.enterprise_url = 'baz'
     self.github.config.save_config()
     self.github.config.user_login = ''
     self.github.config.user_pass = ''
     self.github.config.enterprise_url = ''
     self.github.config.api = None
     config = self.github.config.get_github_config_path(
         self.github.config.CONFIG)
     parser = configparser.RawConfigParser()
     self.github.config.authenticate_cached_credentials(
         config,
         parser,
         enterprise_auth=self.verify_login_pass_url_enterprise)
     assert self.github.config.user_login == 'foo'
     assert self.github.config.user_pass == 'bar'
     assert self.github.config.enterprise_url == 'baz'