### Navigation

- index
- modules |
- SamSifter 0.4.0 documentation »
- Module code »

# Source code for samsifter.util.testing

    # -*- coding: utf-8 -*-
    """
    Created on Tue Jan 13 16:49:20 2015

    @author: aldehoff
    """
    from samsifter.models.workflow import Workflow
    from samsifter.models.parameter import (FilterParameter, FilterThreshold,
                                            FilterFilepath, FilterSwitch)
    from samsifter.models.filter import FilterItem

    def create_workflow():
        """
        Generate workflow for test purposes.
        """
        wf = Workflow()
        wf.set_in_filename("/some/path/to/a/file.sam")
        for idx in range(5):
            fp = FilterParameter("parameter%i" % idx, "a pretty parameter")
            ft = FilterThreshold("threshold%i" % idx, "a thrifty threshold")
            ff = FilterFilepath("filepath%i" % idx, "a funky filepath")
            fs = FilterSwitch("switch%i" % idx, "a super switch")

            f = FilterItem("filter%i" % idx, "a fine filter")
            f.add_parameter(fp)
            f.add_parameter(ft)
            f.add_parameter(ff)
            f.add_parameter(fs)

            wf.getModel().insertItem(f)
        return wf

### Navigation

- index
- modules |
- SamSifter 0.4.0 documentation »
- Module code »