Пример #1
0
def __assert_output_format_is( expected, output, input_extensions=[], param_context=[], add_collection=False ):
    inputs = {}
    last_ext = "data"
    i = 1
    for name, ext in input_extensions:
        hda = model.HistoryDatasetAssociation(extension=ext)
        hda.metadata.random_field = str(i)  # Populate a random metadata field for testing
        inputs[ name ] = hda
        last_ext = ext
        i += 1

    input_collections = {}
    if add_collection:
        hda_forward = model.HistoryDatasetAssociation(extension="txt")
        hda_reverse = model.HistoryDatasetAssociation(extension="txt")
        c1 = model.DatasetCollection(collection_type="pair")
        hc1 = model.HistoryDatasetCollectionAssociation(collection=c1, name="HistoryCollectionTest1")

        dce1 = model.DatasetCollectionElement(collection=c1, element=hda_forward, element_identifier="forward", element_index=0)
        dce2 = model.DatasetCollectionElement(collection=c1, element=hda_reverse, element_identifier="reverse", element_index=1)
        c1.elements = [dce1, dce2]

        input_collections["hdcai"] = [(hc1, False)]

    actual_format = determine_output_format( output, param_context, inputs, input_collections, last_ext )
    assert actual_format == expected, "Actual format %s, does not match expected %s" % (actual_format, expected)
Пример #2
0
def __assert_output_format_is( expected, output, input_extensions=[], param_context=[] ):
    inputs = {}
    last_ext = "data"
    i = 1
    for name, ext in input_extensions:
        hda = model.HistoryDatasetAssociation(extension=ext)
        hda.metadata.random_field = str(i)  # Populate a random metadata field for testing
        inputs[ name ] = hda
        last_ext = ext
        i += 1

    actual_format = determine_output_format( output, param_context, inputs, last_ext )
    assert actual_format == expected, "Actual format %s, does not match expected %s" % (actual_format, expected)