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

Method test_get_access_token_valid

tests/cli/test_cli_auth.py:173–176  ·  view source on GitHub ↗
(self, mock_validate, mock_load)

Source from the content-addressed store, hash-verified

171 @patch("codecarbon.cli.auth._load_credentials")
172 @patch("codecarbon.cli.auth._validate_access_token")
173 def test_get_access_token_valid(self, mock_validate, mock_load):
174 mock_load.return_value = {"access_token": "a", "refresh_token": "r"}
175 mock_validate.return_value = True
176 self.assertEqual(auth.get_access_token(), "a")
177
178 @patch("codecarbon.cli.auth._load_credentials", side_effect=OSError("missing"))
179 def test_get_access_token_raises_when_credentials_missing(self, mock_load):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected