#NEWLINE# def testNormalizeInfoPages( self ) : #NEWLINE# #INDENT# r = self . getRecipe ( ) #NEWLINE# path = os . path . join ( os . path . sep , r . macros . infodir , 'man1' , 'foo.gz' ) #NEWLINE# filePath = util . joinPaths ( self . destdir , path ) #NEWLINE# newPath = os . path . join ( os . path . sep , r . macros . infodir , 'foo.gz' ) #NEWLINE# self . touch ( filePath ) #NEWLINE# g = gzip . open ( filePath , 'w' ) #NEWLINE# g . write ( 'some comrpessed data' ) #NEWLINE# g . close ( ) #NEWLINE# r . NormalizeInfoPages ( ) #NEWLINE# m = magic . Magic ( path , self . destdir ) #NEWLINE# m . name = 'gzip' #NEWLINE# m . contents [ 'compression' ] = 5 #NEWLINE# r . magic = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# r . magic [ path ] = m #NEWLINE# r . magic [ newPath ] = m #NEWLINE# r . _policyMap [ 'NormalizeInfoPages' ] . doProcess ( r ) #NEWLINE# self . assertFalse ( os . path . exists ( filePath ) ) #NEWLINE# self . assertFalse ( ( not os . path . exists ( util . joinPaths ( self . destdir , newPath ) ) ) ) #NEWLINE# self . assertEquals ( r . _pathTranslations , [ ( '/usr/share/info/man1/foo.gz' , '/usr/share/info/foo.gz' ) ] )