<s> __revision__ = "<STR_LIT>" <EOL> import sys <EOL> import unittest <EOL> import SCons . Errors <EOL> import SCons . Node . Alias <EOL> class AliasTestCase ( unittest . TestCase ) : <EOL> def test_AliasNameSpace ( self ) : <EOL> """<STR_LIT>""" <EOL> ans = SCons . Node . Alias . AliasNameSpace ( ) <EOL> assert not ans is None , ans <EOL> def test_ANS_Alias ( self ) : <EOL> """<STR_LIT>""" <EOL> ans = SCons . Node . Alias . AliasNameSpace ( ) <EOL> a1 = ans . Alias ( '<STR_LIT>' ) <EOL> assert a1 . name == '<STR_LIT>' , a1 . name <EOL> a2 = ans . Alias ( '<STR_LIT>' ) <EOL> assert a1 is a2 , ( a1 , a2 ) <EOL> def test_get_contents ( self ) : <EOL> """<STR_LIT>""" <EOL> class DummyNode : <EOL> def __init__ ( self , contents ) : <EOL> self . contents = contents <EOL> def get_csig ( self ) : <EOL> return self . contents <EOL> def get_contents ( self ) : <EOL> return self . contents <EOL> ans = SCons . Node . Alias . AliasNameSpace ( ) <EOL> ans . Alias ( '<STR_LIT>' ) <EOL> a = ans . lookup ( '<STR_LIT>' ) <EOL> a . sources = [ DummyNode ( '<STR_LIT>' ) , DummyNode ( '<STR_LIT>' ) , DummyNode ( '<STR_LIT>' ) ] <EOL> c = a . get_contents ( ) <EOL> assert c == '<STR_LIT>' , c <EOL> def test_lookup ( self ) : <EOL> """<STR_LIT>""" <EOL> ans = SCons . Node . Alias . AliasNameSpace ( ) <EOL> ans . Alias ( '<STR_LIT>' ) <EOL> a = ans . lookup ( '<STR_LIT>' ) <EOL> assert a . name == '<STR_LIT>' , a . name <EOL> a1 = ans . lookup ( '<STR_LIT>' ) <EOL> assert a is a1 , a1 <EOL> a = ans . lookup ( '<STR_LIT>' ) <EOL> assert a == None , a <EOL> def test_Alias ( self ) : <EOL> """<STR_LIT>""" <EOL> a1 = SCons . Node . Alias . Alias ( '<STR_LIT:a>' ) <EOL> assert a1 . name == '<STR_LIT:a>' , a1 . name <EOL> a2 = SCons . Node . Alias . Alias ( '<STR_LIT:a>' ) <EOL> assert a2 . name == '<STR_LIT:a>' , a2 . name <EOL> assert not a1 is a2 <EOL> assert a1 . name == a2 . name <EOL> class AliasNodeInfoTestCase ( unittest . TestCase ) : <EOL> def test___init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> ans = SCons . Node . Alias . AliasNameSpace ( ) <EOL> aaa = ans . Alias ( '<STR_LIT>' ) <EOL> ni = SCons . Node . Alias . AliasNodeInfo ( aaa ) <EOL> class AliasBuildInfoTestCase ( unittest . TestCase ) : <EOL> def test___init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> ans = SCons . Node . Alias . AliasNameSpace ( ) <EOL> aaa = ans . Alias ( '<STR_LIT>' ) <EOL> bi = SCons . Node . Alias . AliasBuildInfo ( aaa ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> suite = unittest . TestSuite ( ) <EOL> tclasses = [ <EOL> AliasTestCase , <EOL> AliasBuildInfoTestCase , <EOL> AliasNodeInfoTestCase , <EOL> ] <EOL> for tclass in tclasses : <EOL> names = unittest . getTestCaseNames ( tclass , '<STR_LIT>' ) <EOL> suite . addTests ( map ( tclass , names ) ) <EOL> if not unittest . TextTestRunner ( ) . run ( suite ) . wasSuccessful ( ) : <EOL> sys . exit ( <NUM_LIT:1> ) </s>
