Example #1
0
    def test_multi_task_snakefile(self):
        snakefile = Snakefile(path=here('fixtures', 'multi_task_snakefile.yml'))
        snakefile.parse()

        assert_equal(len(snakefile.tasks), 3)
        assert_equal(snakefile.default, snakefile.task())
        assert_equal(snakefile.task(0).name, "I am the first task")
        assert_equal(snakefile.task(1).name, "I am the second task")
        assert_equal(snakefile.task(2).name, "I am the third task")
Example #2
0
    def test_multi_step_snakefile(self):
        snakefile = Snakefile(path=here('fixtures', 'multi_step_snakefile.yml'))
        snakefile.parse()

        assert_equal(len(snakefile.tasks), 1)
        assert_equal(type(snakefile.task()), Task)
        assert_equal(len(snakefile.task().steps), 3)
        assert_equal(snakefile.task().steps[0], "echo '1'")
        assert_equal(snakefile.task().steps[1], "echo '2'")
        assert_equal(snakefile.task().steps[2], "echo '3'")
Example #3
0
    def test_basic_parse(self):
        snakefile = Snakefile(path=here('fixtures', 'basic_snakefile.yml'))
        snakefile.parse()

        assert_equal(len(snakefile.tasks), 1)
        assert_equal(type(snakefile.task()), Task)
        assert_equal(snakefile.default, snakefile.task())
        assert_equal(snakefile.task().pre_build, None)
        assert_equal(snakefile.task().post_build, None)
        assert_equal(len(snakefile.task().steps), 1)
        assert_equal(snakefile.task().steps[0], "echo 'foo'")
Example #4
0
 def test_missing(self):
     Snakefile(path=here('fixtures', 'i_am_not_here.yml')).parse()
Example #5
0
 def test_yaml_error(self):
     Snakefile(path=here('fixtures', 'malformed_snakefile.yml')).parse()
Example #6
0
 def test_invalid(self):
     Snakefile(path=here('fixtures', 'invalid_snakefile.yml')).parse()
Example #7
0
    def test_get_invalid_task_by_id(self):
        snakefile = Snakefile(path=here('fixtures', 'multi_task_snakefile.yml'))
        snakefile.parse()

        snakefile.task(task_id="wat")
Example #8
0
    def test_get_task_by_id(self):
        snakefile = Snakefile(path=here('fixtures', 'multi_task_snakefile.yml'))
        snakefile.parse()

        assert_equal(snakefile.task(1), snakefile.task(task_id="hamburger"))