<s> import sys , os , unittest , logging <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> jasyroot = os . path . normpath ( os . path . join ( os . path . abspath ( sys . argv [ <NUM_LIT:0> ] ) , os . pardir , os . pardir , os . pardir ) ) <EOL> sys . path . insert ( <NUM_LIT:0> , jasyroot ) <EOL> print ( "<STR_LIT>" % jasyroot ) <EOL> import jasy . core . Options as Options <EOL> class Tests ( unittest . TestCase ) : <EOL> def test_add ( self ) : <EOL> options = Options . Options ( ) <EOL> options . add ( "<STR_LIT:file>" , accept = str , value = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> self . assertEqual ( options . __getattr__ ( "<STR_LIT:file>" ) , '<STR_LIT>' ) <EOL> def test_parse ( self ) : <EOL> options = Options . Options ( ) <EOL> options . parse ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( options . __getattr__ ( "<STR_LIT:file>" ) , "<STR_LIT>" ) <EOL> def test_add_and_parse ( self ) : <EOL> options = Options . Options ( ) <EOL> options . add ( "<STR_LIT:file>" , accept = str , value = "<STR_LIT>" , help = "<STR_LIT>" ) <EOL> options . parse ( [ '<STR_LIT>' , '<STR_LIT:foo>' ] ) <EOL> self . assertEqual ( options . __getattr__ ( "<STR_LIT:file>" ) , "<STR_LIT:foo>" ) <EOL> def test_getTasks ( self ) : <EOL> options = Options . Options ( ) <EOL> options . parse ( [ '<STR_LIT:source>' , '<STR_LIT>' , '<STR_LIT:foo>' ] ) <EOL> self . assertEqual ( options . getTasks ( ) [ <NUM_LIT:0> ] [ '<STR_LIT>' ] , '<STR_LIT:source>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> logging . getLogger ( ) . setLevel ( logging . ERROR ) <EOL> suite = unittest . TestLoader ( ) . loadTestsFromTestCase ( Tests ) <EOL> unittest . TextTestRunner ( verbosity = <NUM_LIT:2> ) . run ( suite ) </s>
