annotate commons/launcher/tests/Test_MapClusterLauncher.py @ 19:9bcfa7936eec

Deleted selected files
author m-zytnicki
date Mon, 29 Apr 2013 03:23:29 -0400
parents 94ab73e8a190
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.MapClusterLauncher import MapClusterLauncher
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_MapClusterLauncher( 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 = MapClusterLauncher()
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: size above which a gap is not penalized anymore (default='%i')" % ( self._i.getGapSize() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20 exp += "\n -m: penalty for a mismatch (default='%i')" % ( self._i.getMismatchPenalty() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 exp += "\n -O: penalty for a gap openning (default='%i')" % ( self._i.getGapOpenPenalty() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22 exp += "\n -e: penalty for a gap extension (default='%i')" % ( self._i.getGapExtendPenalty() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23 obs = self._i.getSpecificHelpAsString()
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24 self.assertEqual( exp, obs )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
27 def test_setASpecificAttributeFromCmdLine( self ):
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
28 self._i.setASpecificAttributeFromCmdLine( "-s", "42" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
29 self.assertEqual( 42, self._i.getGapSize() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
30
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
31 self._i.setASpecificAttributeFromCmdLine( "-m", "-7" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
32 self.assertEqual( -7, self._i.getMismatchPenalty() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
33
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
34 self._i.setASpecificAttributeFromCmdLine( "-O", "15" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
35 self.assertEqual( 15, self._i.getGapOpenPenalty() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
36
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
37 self._i.setASpecificAttributeFromCmdLine( "-e", "5" )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
38 self.assertEqual( 5, self._i.getGapExtendPenalty() )
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
39
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
40 if __name__ == "__main__":
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
41 unittest.main()