#NEWLINE# def testChaoticHierarchy( self ) : #NEWLINE# #INDENT# self . root . src = 'projects/new/manifest.json' #NEWLINE# self . root . _manifest_ = Manifest ( { #NEWLINE# #INDENT# 'name' : 'root' , #NEWLINE# 'build' : { #NEWLINE# #INDENT# 'dir' : 'root_dir' , #NEWLINE# 'main' : 'corge.js' , #NEWLINE# 'files' : [ 'foo.json' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( self . root . path , '' ) #NEWLINE# self . assertEqual ( module_paths . root . source_dir , 'projects/new/root_dir' ) #NEWLINE# self . foo . src = '../foo/manifest.json' #NEWLINE# self . foo . _manifest_ = Manifest ( { #NEWLINE# #INDENT# 'name' : 'foo' , #NEWLINE# 'build' : { #NEWLINE# #INDENT# 'dir' : 'foo_dir_1/foo_dir_2' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( self . foo . path , 'foo' ) #NEWLINE# self . assertEqual ( self . foo . source_dir , 'projects/new/foo/foo_dir_1/foo_dir_2' ) #NEWLINE# self . bar . src = '../bar/manifest.json' #NEWLINE# self . bar . index = self . foo #NEWLINE# self . bar . _manifest_ = Manifest ( { #NEWLINE# #INDENT# 'name' : 'bar' , #NEWLINE# 'build' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( self . bar . path , 'foo/bar' ) #NEWLINE# self . assertEqual ( self . bar . source_dir , 'projects/new/foo/foo_dir_1/bar' ) #NEWLINE# self . baz . src = '../../../baz.json' #NEWLINE# self . baz . index = self . bar #NEWLINE# self . baz . _manifest_ = Manifest ( { #NEWLINE# #INDENT# 'name' : 'baz' , #NEWLINE# 'build' : { #NEWLINE# #INDENT# 'dir' : '../old/baz_src' , #NEWLINE# 'files' : [ 'grault/spam.js' , 'grault/eggs.js' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( self . baz . path , '' ) #NEWLINE# self . assertEqual ( self . baz . source_dir , 'projects/old/baz_src' ) #NEWLINE# module_paths = re . findall ( 'defineModule\\("([^"]+)"' , self . root . content ) #NEWLINE# self . assertEqual ( module_paths [ 0 ] , 'corge.js' ) #NEWLINE# self . assertEqual ( module_paths [ 1 ] , 'foo/qux.js' ) #NEWLINE# self . assertEqual ( module_paths [ 2 ] , 'foo/bar/quux.js' ) #NEWLINE# self . assertEqual ( module_paths [ 3 ] , 'grault/spam.js' ) #NEWLINE# self . assertEqual ( module_paths [ 4 ] , 'grault/eggs.js' )