<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 , os . pardir ) ) <EOL> sys . path . insert ( <NUM_LIT:0> , jasyroot ) <EOL> print ( "<STR_LIT>" % jasyroot ) <EOL> import jasy . js . parse . Parser as Parser <EOL> from jasy . js . MetaData import MetaData <EOL> class Tests ( unittest . TestCase ) : <EOL> def process ( self , code ) : <EOL> tree = Parser . parse ( code ) <EOL> meta = MetaData ( tree ) <EOL> return meta <EOL> def test_other ( self ) : <EOL> meta = self . process ( '''<STR_LIT>''' ) <EOL> self . assertIsInstance ( meta , MetaData ) <EOL> self . assertEqual ( meta . name , None ) <EOL> self . assertIsInstance ( meta . requires , set ) <EOL> self . assertIsInstance ( meta . optionals , set ) <EOL> self . assertIsInstance ( meta . breaks , set ) <EOL> self . assertIsInstance ( meta . assets , set ) <EOL> self . assertEqual ( len ( meta . requires ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . optionals ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . breaks ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . assets ) , <NUM_LIT:0> ) <EOL> def test_name ( self ) : <EOL> meta = self . process ( '''<STR_LIT>''' ) <EOL> self . assertIsInstance ( meta , MetaData ) <EOL> self . assertEqual ( meta . name , "<STR_LIT>" ) <EOL> self . assertIsInstance ( meta . requires , set ) <EOL> self . assertIsInstance ( meta . optionals , set ) <EOL> self . assertIsInstance ( meta . breaks , set ) <EOL> self . assertIsInstance ( meta . assets , set ) <EOL> self . assertEqual ( len ( meta . requires ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . optionals ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . breaks ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . assets ) , <NUM_LIT:0> ) <EOL> def test_classes ( self ) : <EOL> meta = self . process ( '''<STR_LIT>''' ) <EOL> self . assertIsInstance ( meta , MetaData ) <EOL> self . assertEqual ( meta . name , None ) <EOL> self . assertIsInstance ( meta . requires , set ) <EOL> self . assertIsInstance ( meta . optionals , set ) <EOL> self . assertIsInstance ( meta . breaks , set ) <EOL> self . assertIsInstance ( meta . assets , set ) <EOL> self . assertEqual ( len ( meta . requires ) , <NUM_LIT:1> ) <EOL> self . assertEqual ( len ( meta . optionals ) , <NUM_LIT:1> ) <EOL> self . assertEqual ( len ( meta . breaks ) , <NUM_LIT:1> ) <EOL> self . assertEqual ( len ( meta . assets ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( meta . requires , set ( [ "<STR_LIT>" ] ) ) <EOL> self . assertEqual ( meta . breaks , set ( [ "<STR_LIT>" ] ) ) <EOL> self . assertEqual ( meta . optionals , set ( [ "<STR_LIT>" ] ) ) <EOL> def test_assets ( self ) : <EOL> meta = self . process ( '''<STR_LIT>''' ) <EOL> self . assertIsInstance ( meta , MetaData ) <EOL> self . assertEqual ( meta . name , None ) <EOL> self . assertIsInstance ( meta . requires , set ) <EOL> self . assertIsInstance ( meta . optionals , set ) <EOL> self . assertIsInstance ( meta . breaks , set ) <EOL> self . assertIsInstance ( meta . assets , set ) <EOL> self . assertEqual ( len ( meta . requires ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . optionals ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . breaks ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( len ( meta . assets ) , <NUM_LIT:3> ) <EOL> self . assertEqual ( meta . assets , set ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) ) <EOL> def test_asset_escape ( self ) : <EOL> meta = self . process ( '''<STR_LIT>''' ) <EOL> self . assertIsInstance ( meta , MetaData ) <EOL> self . assertEqual ( meta . assets , set ( [ "<STR_LIT>" ] ) ) <EOL> def test_structured ( self ) : <EOL> meta = self . process ( '''<STR_LIT>''' ) <EOL> self . assertIsInstance ( meta , MetaData ) <EOL> self . assertEqual ( meta . assets , set ( [ "<STR_LIT>" ] ) ) <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>
