view 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
line wrap: on
line source

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()