Mercurial > repos > yufei-luo > s_mart
diff commons/launcher/tests/Test_MapClusterLauncher.py @ 31:0ab839023fe4
Uploaded
author | m-zytnicki |
---|---|
date | Tue, 30 Apr 2013 14:33:21 -0400 |
parents | 94ab73e8a190 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/commons/launcher/tests/Test_MapClusterLauncher.py Tue Apr 30 14:33:21 2013 -0400 @@ -0,0 +1,41 @@ +import unittest +from commons.launcher.MapClusterLauncher import MapClusterLauncher + + +class Test_MapClusterLauncher( unittest.TestCase ): + + + def setUp( self ): + self._i = MapClusterLauncher() + + + def tearDown( self ): + self._i = None + + + def test_getSpecificHelpAsString( self ): + exp = "" + exp += "\nspecific options:" + exp += "\n -s: size above which a gap is not penalized anymore (default='%i')" % ( self._i.getGapSize() ) + exp += "\n -m: penalty for a mismatch (default='%i')" % ( self._i.getMismatchPenalty() ) + exp += "\n -O: penalty for a gap openning (default='%i')" % ( self._i.getGapOpenPenalty() ) + exp += "\n -e: penalty for a gap extension (default='%i')" % ( self._i.getGapExtendPenalty() ) + obs = self._i.getSpecificHelpAsString() + self.assertEqual( exp, obs ) + + + def test_setASpecificAttributeFromCmdLine( self ): + self._i.setASpecificAttributeFromCmdLine( "-s", "42" ) + self.assertEqual( 42, self._i.getGapSize() ) + + self._i.setASpecificAttributeFromCmdLine( "-m", "-7" ) + self.assertEqual( -7, self._i.getMismatchPenalty() ) + + self._i.setASpecificAttributeFromCmdLine( "-O", "15" ) + self.assertEqual( 15, self._i.getGapOpenPenalty() ) + + self._i.setASpecificAttributeFromCmdLine( "-e", "5" ) + self.assertEqual( 5, self._i.getGapExtendPenalty() ) + +if __name__ == "__main__": + unittest.main() \ No newline at end of file