MCPcopy Create free account
hub / github.com/mlco2/codecarbon / test_refresh_tokens

Method test_refresh_tokens

tests/cli/test_cli_auth.py:160–169  ·  view source on GitHub ↗
(self, mock_discover, mock_post)

Source from the content-addressed store, hash-verified

158 @patch("codecarbon.cli.auth.requests.post")
159 @patch("codecarbon.cli.auth._discover_endpoints")
160 def test_refresh_tokens(self, mock_discover, mock_post):
161 mock_discover.return_value = {"token_endpoint": "url"}
162 mock_post.return_value.raise_for_status.return_value = None
163 mock_post.return_value.json.return_value = {
164 "access_token": "a",
165 "refresh_token": "r",
166 }
167 result = auth._refresh_tokens("refresh")
168 self.assertIn("access_token", result)
169 self.assertIn("refresh_token", result)
170
171 @patch("codecarbon.cli.auth._load_credentials")
172 @patch("codecarbon.cli.auth._validate_access_token")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected