(self, name, extra_opts, inputs)
| 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', |
nothing calls this directly
no test coverage detected