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

Method test_default_flows

tests/test_cli.py:86–101  ·  view source on GitHub ↗
(self, name, extra_opts, inputs)

Source from the content-addressed store, hash-verified

84 endpoint="endpoint", token="token", client=None, solver=None)),
85 ])
86 def test_default_flows(self, name, extra_opts, inputs):
87 runner = CliRunner()
88 with runner.isolated_filesystem():
89 with mock.patch("dwave.cloud.config.loaders.get_configfile_paths", lambda: ['dwave.conf']):
90 with mock.patch("dwave.cloud.utils.cli.input", side_effect=inputs):
91 result = runner.invoke(cli, [
92 'config', 'create'
93 ] + extra_opts, input=''.join(f"{'' if v is None else v}\n" for v in inputs.values()))
94 self.assertEqual(result.exit_code, 0)
95
96 # load and verify config
97 with isolated_environ(remove_dwave=True):
98 config = load_config()
99 for var, val in inputs.items():
100 if val: # skip empty default confirmations
101 self.assertEqual(config.get(var), val)
102
103 @isolated_environ(empty=True)
104 @mock.patch('dwave.cloud.cli._get_sapi_token_for_leap_project',

Callers

nothing calls this directly

Calls 3

isolated_environClass · 0.90
load_configFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected