-
Notifications
You must be signed in to change notification settings - Fork 0
/
AlignMethodsTests.groovy
68 lines (54 loc) · 1.75 KB
/
AlignMethodsTests.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import java.nio.file.Path
import java.nio.file.Paths
import static groovy.test.GroovyAssert.shouldFail
import nextflow.util.ConfigHelper
import org.junit.Test
import validator.bl.NextflowConfigTests
class AlignMethodsTests extends NextflowConfigTests {
protected Path get_projectDir() {
return Paths.get(
getClass().protectionDomain.codeSource.location.path
).getParent().getParent()
}
@Override
protected def generate_config_text(configobj) {
return """
includeConfig "\${projectDir}/config/align_methods/align_methods.config"
includeConfig "\${projectDir}/config/csv/csv_parser.config"
${ConfigHelper.toCanonicalString(configobj)}
align_methods.set_params_from_input()
"""
}
@Test
void empty_throws_error() {
// Without `params.input_csv`, we expect an exception
shouldFail {
compare()
}
}
@Test
void input_does_nothing() {
// Nothing is done if `params.input` exists
inconfig.params.input = null
expected.params.input = null
compare()
}
@Test
void fake_csv() {
def csvfile = testFolder.newFile("data.csv")
csvfile.withWriter('UTF-8') {
it.writeLine "column_one,column_two,three"
it.writeLine "alpha,beta,gamma"
it.writeLine "delta,epsilon,eta"
}
inconfig.params.input_csv = csvfile.toString()
expected.params.input_csv = csvfile.toString()
expected.params.input = [
FASTQ: [
[column_one: 'alpha', column_two: 'beta', three: 'gamma'],
[column_one: 'delta', column_two: 'epsilon', three: 'eta'],
] as Set
]
compare()
}
}