comparison env/lib/python3.7/site-packages/bioblend/_tests/TestGalaxyToolInputs.py @ 0:26e78fe6e8c4 draft

"planemo upload commit c699937486c35866861690329de38ec1a5d9f783"
author shellac
date Sat, 02 May 2020 07:14:21 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:26e78fe6e8c4
1 from bioblend.galaxy.tools.inputs import (
2 conditional,
3 dataset,
4 inputs,
5 repeat,
6 )
7
8
9 def test_conditional():
10 # Build up example inputs for random_lines1
11 as_dict = inputs().set(
12 "num_lines", 5
13 ).set(
14 "input", dataset("encoded1")
15 ).set(
16 "seed_source", conditional().set(
17 "seed_source_selector", "set_seed"
18 ).set(
19 "seed", "asdf"
20 )
21 ).to_dict()
22 assert as_dict["num_lines"] == 5
23 assert as_dict["input"]["src"] == "hda"
24 assert as_dict["input"]["id"] == "encoded1"
25 assert as_dict["seed_source|seed_source_selector"] == "set_seed"
26 assert as_dict["seed_source|seed"] == "asdf"
27
28
29 def test_repeat():
30 # Build up inputs for cat1
31 as_dict = inputs().set(
32 "input1", dataset("encoded1")
33 ).set(
34 "queries", repeat().instance(
35 inputs().set_dataset_param("input2", "encoded2")
36 ).instance(
37 inputs().set_dataset_param("input2", "encoded3")
38 )
39 ).to_dict()
40 assert as_dict["input1"]["src"] == "hda"
41 assert as_dict["input1"]["id"] == "encoded1"
42 assert as_dict["queries_0|input2"]["src"] == "hda"
43 assert as_dict["queries_0|input2"]["id"] == "encoded2"
44 assert as_dict["queries_1|input2"]["src"] == "hda"
45 assert as_dict["queries_1|input2"]["id"] == "encoded3"