def test_dictionary(monkeypatch, config_files, capsys, command, command_args):
def fake_lxc_config_command(*popenargs, **kwargs):
if 'images.compression_algorithm' in popenargs[0]:
return subprocess.CompletedProcess("fakerun", 0, '')
else:
return subprocess.run(*popenargs, **kwargs)
monkeypatch.setattr(mockablerun, 'run_mockable', fake_lxc_config_command)
parser = edi._setup_command_line_interface()
command_args.append(config_files)
cli_args = parser.parse_args(command_args)
command().run_cli(cli_args)
out, err = capsys.readouterr()
assert err == ''
dictionary = yaml.load(out)
assert dictionary.get('edi_config_directory') == os.path.dirname(config_files)
assert dictionary.get('edi_project_plugin_directory') == os.path.join(os.path.dirname(config_files), 'plugins')
评论列表
文章目录