def _ensure_fresh(self):
   if not self._access_token or self._access_token.needs_refresh():
     self._access_token = auth.get_luci_context_access_token(
         scopes=' '.join([auth.OAUTH_SCOPE_EMAIL, auth.OAUTH_SCOPE_GERRIT]))
 def test_incorrect_port_format(self):
   _mockLocalAuth('account', 'secret', 'port')
   self.assertFalse(auth.has_luci_context_local_auth())
   with self.assertRaises(auth.LuciContextAuthError):
     auth.get_luci_context_access_token()
 def test_no_account_id(self):
   _mockLocalAuth(None, 'secret', 8080)
   self.assertFalse(auth.has_luci_context_local_auth())
   self.assertIsNone(auth.get_luci_context_access_token())
Example #4
0
 def _ensure_fresh(self):
   if not self._access_token or self._access_token.needs_refresh():
     self._access_token = auth.get_luci_context_access_token(
         scopes=' '.join([auth.OAUTH_SCOPE_EMAIL, auth.OAUTH_SCOPE_GERRIT]))
Example #5
0
 def test_incorrect_port_format(self):
   self._mock_local_auth('account', 'secret', 'port')
   self.assertFalse(auth.has_luci_context_local_auth())
   with self.assertRaises(auth.LuciContextAuthError):
     auth.get_luci_context_access_token()
Example #6
0
 def test_no_account_id(self):
   self._mock_local_auth(None, 'secret', 8080)
   self.assertFalse(auth.has_luci_context_local_auth())
   self.assertIsNone(auth.get_luci_context_access_token())