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

Method test_do_get_success

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

Source from the content-addressed store, hash-verified

33 return handler
34
35 def test_do_get_success(self):
36 handler = self._make_handler("/callback?code=abc123&state=xyz")
37 handler.do_GET()
38 # Should set callback_url and not error
39 self.assertIsNone(_CallbackHandler.error)
40 self.assertTrue(
41 _CallbackHandler.callback_url.endswith("/callback?code=abc123&state=xyz")
42 )
43 handler.send_response.assert_called_with(200)
44 handler.send_header.assert_called_with("Content-Type", "text/html")
45 handler.end_headers.assert_called()
46 output = handler.wfile.getvalue().decode()
47 self.assertIn("Login successful", output)
48
49 def test_do_get_error(self):
50 handler = self._make_handler(

Callers

nothing calls this directly

Calls 2

_make_handlerMethod · 0.95
do_GETMethod · 0.80

Tested by

no test coverage detected