示例#1
0
def test_python_operator():
    content = """
name: test
description: test description

steps:
  - name: python
    arguments:
      value: tests/scripts/script1.py
    """
    pyyawl.execute(content, True)
示例#2
0
def test_simpleworkflow_missing_ops():
    content = """
name: test
description: test description

steps:
  - name: echo2
    arguments:
      value: yawl
  - name: echo
    arguments:
      value: world
  - name: papermill
    arguments:
      input_path: tests/notebooks/sum_test.ipynb
      output_path: tests/notebooks/sum_test_out.ipynb
      parameters:
        a: 8
        b: 4
        image_path: ./tests/notebooks/imgs/image_1.jpg
    """
    pyyawl.execute(content, True)
示例#3
0
def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--generate', dest='generate', action='store_true')
    parser.add_argument('--f', type=Path)
    parser.add_argument('--verbose', dest='verbose', action='store_true')
    parser.add_argument('--registry', dest='registry', action='store_true')
    args = parser.parse_args()

    if args.registry:
        print(pyyawl.show_registry(names=True))
    elif args.generate:
        print(pyyawl.generate())
    elif args.f is not None:
        sys.exit(pyyawl.execute(args.f, args.verbose))
    else:
        parser.print_help()
示例#4
0
def test_simpleworkflow_mkdir():
    content = """
name: test
description: test description

steps:
  - name: mkdir
    arguments:
      path: test_dir
  - name: rmdir
    arguments:
      path: test_dir
  - name: ls
    arguments:
      path: .
    """
    results = pyyawl.execute(content, True)
    assert 'test_dir' not in [p.as_posix() for p in results['ls']]
示例#5
0
def test_simpleworkflow():
    definition = PATH / 'test_ops.yaml'
    pyyawl.execute(definition, True)