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

Method test_session_config

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

Source from the content-addressed store, hash-verified

237 self.assertTrue(status)
238
239 def test_session_config(self):
240 config = dict(
241 cert='/path/to/cert',
242 headers={'X-Field': 'Value'},
243 proxies=dict(https='socks5://localhost'),
244 timeout=60,
245 verify=False)
246
247 def verify(session, config):
248 self.assertEqual(session.cert, config['cert'])
249 self.assertEqual({**session.headers, **config['headers']}, session.headers)
250 self.assertEqual(session.proxies, config['proxies'])
251 self.assertEqual(session.default_timeout, config['timeout'])
252 self.assertEqual(session.verify, config['verify'])
253
254 with self.subTest('on construction'):
255 flow = AuthFlow(session_config=config, **self.test_args)
256 verify(flow.session, config)
257
258 with self.subTest('post-construction'):
259 flow = AuthFlow(**self.test_args)
260 flow.update_session(config)
261 verify(flow.session, config)
262
263 def test_token_expires_soon(self):
264 flow = AuthFlow(**self.test_args)

Callers

nothing calls this directly

Calls 2

update_sessionMethod · 0.95
AuthFlowClass · 0.90

Tested by

no test coverage detected