Mercurial > repos > yufei-luo > s_mart
comparison commons/launcher/tests/Test_MapClusterLauncher.py @ 31:0ab839023fe4
Uploaded
author | m-zytnicki |
---|---|
date | Tue, 30 Apr 2013 14:33:21 -0400 |
parents | 94ab73e8a190 |
children |
comparison
equal
deleted
inserted
replaced
30:5677346472b5 | 31:0ab839023fe4 |
---|---|
1 import unittest | |
2 from commons.launcher.MapClusterLauncher import MapClusterLauncher | |
3 | |
4 | |
5 class Test_MapClusterLauncher( unittest.TestCase ): | |
6 | |
7 | |
8 def setUp( self ): | |
9 self._i = MapClusterLauncher() | |
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: size above which a gap is not penalized anymore (default='%i')" % ( self._i.getGapSize() ) | |
20 exp += "\n -m: penalty for a mismatch (default='%i')" % ( self._i.getMismatchPenalty() ) | |
21 exp += "\n -O: penalty for a gap openning (default='%i')" % ( self._i.getGapOpenPenalty() ) | |
22 exp += "\n -e: penalty for a gap extension (default='%i')" % ( self._i.getGapExtendPenalty() ) | |
23 obs = self._i.getSpecificHelpAsString() | |
24 self.assertEqual( exp, obs ) | |
25 | |
26 | |
27 def test_setASpecificAttributeFromCmdLine( self ): | |
28 self._i.setASpecificAttributeFromCmdLine( "-s", "42" ) | |
29 self.assertEqual( 42, self._i.getGapSize() ) | |
30 | |
31 self._i.setASpecificAttributeFromCmdLine( "-m", "-7" ) | |
32 self.assertEqual( -7, self._i.getMismatchPenalty() ) | |
33 | |
34 self._i.setASpecificAttributeFromCmdLine( "-O", "15" ) | |
35 self.assertEqual( 15, self._i.getGapOpenPenalty() ) | |
36 | |
37 self._i.setASpecificAttributeFromCmdLine( "-e", "5" ) | |
38 self.assertEqual( 5, self._i.getGapExtendPenalty() ) | |
39 | |
40 if __name__ == "__main__": | |
41 unittest.main() |