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