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

Method test_do_get_error

tests/cli/test_cli_auth.py:49–61  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 self.assertIn("Login successful", output)
48
49 def test_do_get_error(self):
50 handler = self._make_handler(
51 "/callback?error=access_denied&error_description=User+denied+access"
52 )
53 handler.do_GET()
54 # Should set error and not callback_url
55 self.assertEqual(_CallbackHandler.error, "access_denied")
56 handler.send_response.assert_called_with(400)
57 handler.send_header.assert_called_with("Content-Type", "text/html")
58 handler.end_headers.assert_called()
59 output = handler.wfile.getvalue().decode()
60 self.assertIn("Login failed", output)
61 self.assertIn("User denied access", output)
62
63
64class TestAuthMethods(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

_make_handlerMethod · 0.95
do_GETMethod · 0.80

Tested by

no test coverage detected