How to use the chaostoolkit.cli.cli function in chaostoolkit

To help you get started, we’ve selected a few chaostoolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chaostoolkit / chaostoolkit / tests / test_cli.py View on Github external
disco_path = os.path.join(base_path, 'fixtures', 'disco.json')
    export_path_json = os.path.join(base_path, 'experiment.json')
    export_path_yaml = os.path.join(base_path, 'experiment.yaml')

    export_paths = [None, export_path_json, export_path_yaml]

    for export_path in export_paths:
        cli_params = ['--settings', empty_settings_path,
                      'init', '--discovery-path', disco_path]

        if export_path:
            cli_params.extend(['--experiment-path', export_path])
        else:
            export_path = os.path.join(os.getcwd(), "experiment.json")

        result = runner.invoke(cli, cli_params, input=inputs)

        assert result.exit_code == 0
        assert result.exception is None
        assert os.path.exists(export_path)

        notify.assert_any_call(ANY, InitFlowEvent.InitStarted)
        notify.assert_any_call(ANY, InitFlowEvent.InitCompleted, ANY)
github chaostoolkit / chaostoolkit / tests / test_cli.py View on Github external
def test_source_experiment_is_mandatory():
    runner = CliRunner()
    result = runner.invoke(cli, ['run'])
    assert result.exit_code == 2
    assert result.exception
    assert 'Error: Missing argument "SOURCE".' in result.output