-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_samplesheet.py
executable file
·41 lines (32 loc) · 1.36 KB
/
test_samplesheet.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
unit tests for the samplesheet module
"""
import unittest
import samplesheet
samplesheet1 = "fixtures/SampleSheet.csv"
samplesheet_bad_samples = "fixtures/SampleSheet-Bad1.csv"
samplesheet_bad_lines = "fixtures/SampleSheet-Bad2.csv"
samplesheet_dups = "fixtures/SampleSheet-dup.csv"
class TestSuperFilter(unittest.TestCase):
def test_true(self):
self.assertTrue(True, 'Demo assertion')
def test_fail(self):
self.assertFalse(False)
def test_error(self):
self.assertRaises(ValueError)
def test_IEMFile_sheet_is_valid1(self):
sheet_obj = samplesheet.IEMFile(path = samplesheet1)
self.assertTrue(sheet_obj.isValid(), "Valid samplesheet returns invalid status")
def test_IEMFile_sheet_invalid_lines1(self):
sheet_obj = samplesheet.IEMFile(path = samplesheet_bad_lines)
self.assertRaises(ValueError, sheet_obj.isValid, _raise = True)
def test_IEMFile_sheet_invalid_samples1(self):
sheet_obj = samplesheet.IEMFile(path = samplesheet_bad_samples)
self.assertRaises(ValueError, sheet_obj.isValid, _raise = True)
def test_IEMFile_duplicate_samples1(self):
sheet_obj = samplesheet.IEMFile(path = samplesheet_dups)
self.assertRaises(ValueError, sheet_obj.isValid, _raise = True)
if __name__ == '__main__':
unittest.main()