-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_plutoPreRunTestCase.py
68 lines (58 loc) · 2.02 KB
/
test_plutoPreRunTestCase.py
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
import os
from . import (
CWLFile,
PlutoPreRunTestCase,
OFile
)
class TestPlutoPreRunTestCase(PlutoPreRunTestCase):
cwl_file = CWLFile('copy.cwl', CWL_DIR = os.path.abspath('cwl'))
def setUpRun(self):
"""
This will get called ONCE during test setup to run the pipeline
"""
lines = [
['# comment 1'],
['# comment 2'],
['Hugo_Symbol', 't_depth', 't_alt_count'],
['SUFU', '100', '75'],
['GOT1', '100', '1'],
['SOX9', '100', '0'],
]
input = self.write_table(tmpdir = self.tc.tmpdir, filename = 'input.maf', lines = lines)
self.input = {
"input_file": {
"class": "File",
"path": input
},
"output_filename": 'output.maf',
}
output_json, output_dir = self.run_cwl()
return(output_json, output_dir)
def getExpected(self, output_dir):
return({"output_file": OFile(
name = "output.maf",
dir = output_dir,
size = 90,
hash = '7bcfa105aa117881f032765595bec2e9a016a1e7')})
def test_foo1(self):
self.assertEqual(
self.res.output['output_file']['checksum'],
self.res.expected['output_file']['checksum'])
def test_bar1(self):
self.assertCWLDictEqual(self.res.output, self.res.expected)
def test_baz1(self):
self.assertNumMutationsHash(
OFile.init_dict(self.res.output['output_file']).path,
3, '27e9aa95e80f808553624eb7522622f8')
def test_foo2(self):
self.assertMutFieldContains(
OFile.init_dict(self.res.output['output_file']).path,
"Hugo_Symbol", ["SUFU", "GOT1", "SOX9"], containsAll = True)
def test_bar2(self):
self.assertMutFieldDoesntContain(
OFile.init_dict(self.res.output['output_file']).path,
"Hugo_Symbol", [""])