(self, mock_discover, mock_post)
| 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") |
nothing calls this directly
no outgoing calls
no test coverage detected