MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / test_auth_url

Method test_auth_url

tests/auth/test_flows.py:58–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

56 self.creds.close()
57
58 def test_auth_url(self):
59 flow = AuthFlow(**self.test_args)
60
61 url = flow.get_authorization_url()
62 q = dict(parse_qsl(urlsplit(url).query))
63
64 self.assertTrue(url.startswith(self.authorization_endpoint))
65 self.assertEqual(q['response_type'], 'code')
66 self.assertEqual(q['client_id'], self.client_id)
67 self.assertEqual(q['redirect_uri'], self.redirect_uri_oob)
68 self.assertEqual(q['scope'], ' '.join(self.scopes))
69 self.assertIn('state', q)
70 # pkce
71 self.assertIn('code_challenge', q)
72 self.assertEqual(q['code_challenge_method'], 'S256')
73
74 def test_fetch_token_state(self):
75 flow = AuthFlow(**self.test_args)

Callers

nothing calls this directly

Calls 2

get_authorization_urlMethod · 0.95
AuthFlowClass · 0.90

Tested by

no test coverage detected