INNER CODE UNIT · Python
test_callback_exchanges_and_only_the_poll_token_can_read_it
Kounex/obs_blade · tool/kick_auth_proxy/test_proxy.py:73
def test_callback_exchanges_and_only_the_poll_token_can_read_it(self):
proxy._sessions.clear()
proxy.register_session("state-1", "verifier-1", "poll-1", now=1_000)
def forward(form):
self.assertEqual(form["code"], "code-1")
self.assertEqual(form["client_secret"], "secret-1")
return 200, b'{"access_token":"access-1","expires_in":3600}'
self.assertTrue(
proxy.accept_callback(
{
"code": "code-1",
"state": "state-1",
},
forward,
now=1_001,
)