annotate commons/launcher/tests/Test_RepeatMaskerClusterLauncher.py @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 import unittest
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 from commons.launcher.RepeatMaskerClusterLauncher import RepeatMaskerClusterLauncher
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5 class Test_RepeatmaskerClusterLauncher( unittest.TestCase ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8 def setUp( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9 self._i = RepeatMaskerClusterLauncher()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12 def tearDown( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 self._i = None
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16 def test_getSpecificHelpAsString( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 exp = ""
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18 exp += "\nspecific options:"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 exp += "\n -s: name of the subject file (repeats, format='fasta')"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20 exp += "\n -n: nb of processors to use in parallel (default=1)"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 exp += "\n -g: calculate the GC content"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22 exp += "\n -b: skip bacterial insertion element check"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 exp += "\n -l: mask low-complexity DNA or simple repeats"
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24 obs = self._i.getSpecificHelpAsString()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25 self.assertEqual( exp, obs )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
27
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
28 def test_setASpecificAttributeFromCmdLine( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
29 self._i.setASpecificAttributeFromCmdLine( "-s", "dummySubjectFile.fa" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
30 self.assertEqual( "dummySubjectFile.fa", self._i.getSubjectFile() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
31
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
32 self._i.setASpecificAttributeFromCmdLine( "-n", "2" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
33 self.assertEqual( 2, self._i.getNbProcessors() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
34
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
35 self._i.setASpecificAttributeFromCmdLine( "-g" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
36 self.assertTrue( self._i.getCalculateGCcontent() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
37
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
38 self._i.setASpecificAttributeFromCmdLine( "-b" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
39 self.assertTrue( self._i.getSkipBacterialIsCheck() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
40
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
41 self._i.setASpecificAttributeFromCmdLine( "-l" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
42 self.assertFalse( self._i.getMaskSsr() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
43
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
44 if __name__ == "__main__":
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
45 unittest.main()