#NEWLINE# def testNormalizeManPages( self ) : #NEWLINE# #INDENT# r = self . getRecipe ( ) #NEWLINE# path = os . path . join ( os . path . sep , r . macros . mandir , 'man1' , 'foo.1.gz' ) #NEWLINE# path2 = os . path . join ( os . path . sep , r . macros . mandir , 'man1' , 'bar.1.bz2' ) #NEWLINE# filePath = util . joinPaths ( self . destdir , path ) #NEWLINE# filePath2 = util . joinPaths ( self . destdir , path2 ) #NEWLINE# self . touch ( filePath ) #NEWLINE# self . touch ( filePath2 [ : ( - 4 ) ] , contents = 'text' ) #NEWLINE# g = gzip . open ( filePath , 'w' ) #NEWLINE# g . write ( 'some comrpessed data' ) #NEWLINE# g . close ( ) #NEWLINE# self . captureOutput ( os . system , ( 'bzip2 %s' % filePath2 [ : ( - 4 ) ] ) ) #NEWLINE# r . NormalizeManPages ( ) #NEWLINE# self . captureOutput ( r . _policyMap [ 'NormalizeManPages' ] . doProcess , r ) #NEWLINE# self . assertFalse ( ( not os . path . exists ( filePath ) ) ) #NEWLINE# self . assertFalse ( ( not os . path . exists ( ( filePath2 [ : ( - 4 ) ] + '.gz' ) ) ) ) #NEWLINE# self . assertFalse ( os . path . exists ( path ) ) #NEWLINE# self . assertEquals ( sorted ( r . _pathTranslations ) , sorted ( [ ( '/usr/share/man/man1/foo.1.gz' , '/usr/share/man/man1/foo.1' ) , ( '/usr/share/man/man1/bar.1.bz2' , '/usr/share/man/man1/bar.1' ) , ( '/usr/share/man/man1/bar.1' , '/usr/share/man/man1/bar.1.gz' ) , ( '/usr/share/man/man1/foo.1' , '/usr/share/man/man1/foo.1.gz' ) ] ) )