Skip to content

Commit a79e164

Browse files
committed
Adds a test fo rthe new function
1 parent 92ab8cf commit a79e164

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/structure_function_tests.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,24 @@ def test_str_param_checker():
6464
arg.params = "mainparams"
6565
sw.str_param_checker(arg)
6666
assert arg.params == ["-m", "mainparams", "-e", "extraparams"]
67+
68+
69+
def test_seed_generator():
70+
"""
71+
Tests if the Seed generator is working as intended.
72+
"""
73+
k_list = [1, 2]
74+
replicates = [1, 2, 3]
75+
extra_options = ""
76+
77+
mock_jobs = [(2, 3), (2, 2), (2, 1), (1, 3), (1, 2), (1, 1)]
78+
returned_jobs = sw.seed_generator(extra_options, k_list, replicates)
79+
assert returned_jobs == mock_jobs
80+
81+
# Add a seed option
82+
extra_options = "-D 1234"
83+
84+
mock_jobs = [("7394266", 2, 3), ("1960426", 2, 2), ("125686", 2, 1),
85+
("1520747", 1, 3), ("9768157", 1, 2), ("585963", 1, 1)]
86+
returned_jobs = sw.seed_generator(extra_options, k_list, replicates)
87+
assert returned_jobs == mock_jobs

0 commit comments

Comments
 (0)