Example #1
0
def test_pattern_verbose(tmpdir, num_nodes, patterns, files):
    make_files_and_cd(tmpdir, files)
    runner = CliRunner()
    result = runner.invoke(cli, [
        "--verbose",
    ])
    assert result.exit_code == 0
def test_create_file(tmpdir, name, num_nodes, files):
    make_files_and_cd(tmpdir, files)

    print(f"testing scenario {name}")
    pipelines = find_kedro(directory=".", verbose=True)
    assert (
        len(pipelines["__default__"].nodes) == num_nodes
    ), f"did not collect all nodes from { name }.py"
Example #3
0
def test_create_file(tmpdir, num_nodes, patterns, files):
    make_files_and_cd(tmpdir, files)

    print(f"testing scenario {patterns}")
    print(f'files created: {list(Path().glob("**/*"))}')
    pipelines = find_kedro(directory=".", patterns=patterns, verbose=True)
    assert (
        len(pipelines["__default__"].nodes) == num_nodes
    ), f"did not collect all nodes from test using\npattern: {patterns}\nfiles: {[file.name for file  in files]}"
Example #4
0
def test_pattern(tmpdir, num_nodes, patterns, files):
    make_files_and_cd(tmpdir, files)
    runner = CliRunner()
    if type(patterns) == list:
        args = list(roundrobin(["--patterns"] * len(patterns), patterns))
        result = runner.invoke(cli, args)
    else:
        result = runner.invoke(cli, ["--patterns", patterns])
    import json

    pipeline = json.loads(result.output)

    assert result.exit_code == 0
    assert len(pipeline["__default__"]) == num_nodes
Example #5
0
def test_file_patterns(tmpdir, name, num_nodes, files):
    make_files_and_cd(tmpdir, files)
    runner = CliRunner()
    # if type(patterns) == list:
    # args = list(roundrobin(['--file-patterns'] * len(patterns), patterns))
    # result = runner.invoke(cli, args)
    # else:
    # result = runner.invoke(cli, ['--patterns', patterns])
    result = runner.invoke(cli)
    import json

    pipeline = json.loads(result.output)

    assert result.exit_code == 0
    assert len(pipeline["__default__"]) == num_nodes
Example #6
0
def test_file_pattern(tmpdir, num_nodes, file_patterns, files):
    make_files_and_cd(tmpdir, files)

    runner = CliRunner()
    if type(file_patterns) == list:
        args = list(
            roundrobin(["--file-patterns"] * len(file_patterns),
                       file_patterns))
        result = runner.invoke(cli, args)
    else:
        result = runner.invoke(cli, ["--file-patterns", file_patterns])
    import json

    pipelines = json.loads(result.output)

    assert result.exit_code == 0
    assert (
        len(pipelines["__default__"]) == num_nodes
    ), f"did not collect all nodes from test using\npattern: {file_patterns}\nfiles: {[file.name for file in file_patterns]}"