MCPcopy Create free account
hub / github.com/authlib/authlib / test_refresh_token

Function test_refresh_token

tests/clients/test_httpx/test_assertion_client.py:20–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19
20def test_refresh_token():
21 def verifier(request):
22 content = request.form
23 if str(request.url) == "https://provider.test/token":
24 assert "assertion" in content
25
26 with AssertionClient(
27 "https://provider.test/token",
28 issuer="foo",
29 subject="foo",
30 audience="foo",
31 alg="HS256",
32 key="secret",
33 transport=WSGITransport(MockDispatch(default_token, assert_func=verifier)),
34 ) as client:
35 client.get("https://provider.test")
36
37 # trigger more case
38 now = int(time.time())
39 with AssertionClient(
40 "https://provider.test/token",
41 issuer="foo",
42 subject=None,
43 audience="foo",
44 issued_at=now,
45 expires_at=now + 3600,
46 header={"alg": "HS256"},
47 key="secret",
48 scope="email",
49 claims={"test_mode": "true"},
50 transport=WSGITransport(MockDispatch(default_token, assert_func=verifier)),
51 ) as client:
52 client.get("https://provider.test")
53 client.get("https://provider.test")
54
55
56def test_client_id():

Callers

nothing calls this directly

Calls 3

AssertionClientClass · 0.90
MockDispatchClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected