Commit e7d73856 authored by Matthias Bernt's avatar Matthias Bernt
Browse files

add unit test for is_a_yaml_with_class

as used in planemo
parent bff1a04c
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
import os
import tempfile

from galaxy.tool_util.loader_directory import is_a_yaml_with_class

def test_is_a_yaml_with_class():
    with tempfile.NamedTemporaryFile("w", suffix=".yaml", delete=False) as tf:
        fname = tf.name
        tf.write("""class: GalaxyWorkflow
name: "Test Workflow"
inputs:
  - id: input1
outputs:
  - id: wf_output_1
    outputSource: first_cat/out_file1
steps:
  - tool_id: cat
    label: first_cat
    in:
      input1: input1""")

    assert is_a_yaml_with_class(fname, ["GalaxyWorkflow"])
    os.unlink(fname)
 No newline at end of file