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

Method test_defaults

tests/api/test_api_clients.py:49–66  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

47 """Session is initiated from config."""
48
49 def test_defaults(self):
50 with self.assertRaises(ValueError):
51 DWaveAPIClient()
52
53 endpoint = constants.DEFAULT_METADATA_API_ENDPOINT
54 client = DWaveAPIClient(endpoint=endpoint)
55
56 defaults = DWaveAPIClient.DEFAULTS.copy()
57 defaults.update(endpoint=endpoint)
58
59 self.assertEqual(client.config, defaults)
60 self.assertIsInstance(client.session, requests.Session)
61
62 # verify Retry object config
63 retry = client.session.get_adapter('https://').max_retries
64 conf = DWaveAPIClient.DEFAULTS['retry']
65 client.close()
66 self.assertEqual(retry.total, conf['total'])
67
68 def test_init(self):
69 config = dict(endpoint='https://test.com/path/',

Callers

nothing calls this directly

Calls 3

closeMethod · 0.95
DWaveAPIClientClass · 0.90
copyMethod · 0.80

Tested by

no test coverage detected