<s> import filecmp <EOL> import os <EOL> def get_test_path ( ) : <EOL> return os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> def are_dir_trees_equal ( dir1 , dir2 ) : <EOL> """<STR_LIT>""" <EOL> dirs_cmp = filecmp . dircmp ( dir1 , dir2 ) <EOL> if len ( dirs_cmp . left_only ) > <NUM_LIT:0> or len ( dirs_cmp . right_only ) > <NUM_LIT:0> or len ( dirs_cmp . funny_files ) > <NUM_LIT:0> : <EOL> if '<STR_LIT>' in dirs_cmp . left_only and len ( dirs_cmp . left_only ) == <NUM_LIT:1> : <EOL> return True <EOL> if '<STR_LIT>' in dirs_cmp . right_only and len ( dirs_cmp . right_only ) == <NUM_LIT:1> : <EOL> return True <EOL> print "<STR_LIT>" . format ( dir1 , dir2 ) <EOL> print "<STR_LIT>" . format ( <EOL> dirs_cmp . left_only , dirs_cmp . right_only , dirs_cmp . funny_files ) <EOL> return False <EOL> ( _ , mismatch , errors ) = filecmp . cmpfiles ( <EOL> dir1 , dir2 , dirs_cmp . common_files , shallow = False ) <EOL> if len ( mismatch ) > <NUM_LIT:0> or len ( errors ) > <NUM_LIT:0> : <EOL> print "<STR_LIT>" . format ( mismatch , errors ) <EOL> return False <EOL> for common_dir in dirs_cmp . common_dirs : <EOL> new_dir1 = os . path . join ( dir1 , common_dir ) <EOL> new_dir2 = os . path . join ( dir2 , common_dir ) <EOL> if not are_dir_trees_equal ( new_dir1 , new_dir2 ) : <EOL> return False <EOL> return True </s>
