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

Method test_refresh_token

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

Source from the content-addressed store, hash-verified

132 self.assertEqual(self.creds[self.leap_api_endpoint], self.token)
133
134 def test_refresh_token(self):
135 flow = AuthFlow(**self.test_args)
136 self.creds.clear()
137
138 with mock.patch.object(flow.session, 'refresh_token',
139 return_value=self.token) as m:
140 flow.refresh_token()
141
142 m.assert_called_once_with(url=flow.token_endpoint)
143
144 # verify token is persisted
145 self.assertEqual(self.creds[self.leap_api_endpoint], self.token)
146
147 def test_ensure_active_token(self):
148 flow = AuthFlow(**self.test_args)

Callers

nothing calls this directly

Calls 3

refresh_tokenMethod · 0.95
AuthFlowClass · 0.90
clearMethod · 0.80

Tested by

no test coverage detected