<s> import sys <EOL> import os <EOL> import conary_test <EOL> from conary_test import rephelp <EOL> from conary . deps import deps <EOL> from conary import versions <EOL> from conary . build . policy import PolicyError <EOL> from conary . build . errors import CookError <EOL> from conary import rpmhelper <EOL> from conary_test import resources <EOL> pythonVer = "<STR_LIT>" % sys . version_info [ : <NUM_LIT:2> ] <EOL> class RpmCapsuleTest ( rephelp . RepositoryHelper ) : <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleEpoch ( self ) : <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> self . assertEquals ( trv . troveInfo . capsule . rpm . epoch ( ) , <NUM_LIT> ) <EOL> @ conary_test . rpm <EOL> def testScriptHasLdSoConf ( self ) : <EOL> '<STR_LIT>' <EOL> recipestr = """<STR_LIT>""" <EOL> self . assertRaises ( PolicyError , self . buildRecipe , recipestr , <EOL> '<STR_LIT>' ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleDepPolicy ( self ) : <EOL> """<STR_LIT>""" <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . cfg . enableRPMVersionDeps = False <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> self . assertEquals ( str ( trv . provides ( ) ) , <EOL> '<STR_LIT:\n>' . join ( ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) ) <EOL> self . assertEquals ( str ( trv . requires ) , <EOL> '<STR_LIT:\n>' . join ( ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) ) <EOL> self . cfg . enableRPMVersionDeps = True <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> self . assertEquals ( str ( trv . provides ( ) ) , <EOL> '<STR_LIT:\n>' . join ( ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) ) <EOL> self . assertEquals ( str ( trv . requires ) , <EOL> '<STR_LIT:\n>' . join ( ( '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleDepPolicy2 ( self ) : <EOL> """<STR_LIT>""" <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> try : <EOL> self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> except CookError , e : <EOL> err = str ( e ) . split ( '<STR_LIT:\n>' ) [ <NUM_LIT:1> ] <EOL> self . assertEqual ( <EOL> str ( err ) , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleDepPolicy3 ( self ) : <EOL> """<STR_LIT>""" <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> try : <EOL> self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> except CookError , e : <EOL> err = str ( e ) . split ( '<STR_LIT:\n>' ) [ <NUM_LIT:1> ] <EOL> self . assertEqual ( <EOL> str ( err ) , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> @ conary_test . rpm <EOL> def testRPMProvidesExceptions ( self ) : <EOL> """<STR_LIT>""" <EOL> recipe1 = """<STR_LIT>""" <EOL> recipe2 = recipe1 + "<STR_LIT>" <EOL> def getPerlProvides ( trv ) : <EOL> return [ x for x in str ( trv . provides ( ) ) . split ( '<STR_LIT:\n>' ) <EOL> if x . startswith ( '<STR_LIT>' ) ] <EOL> self . cfg . enableRPMVersionDeps = False <EOL> r1trv = self . build ( recipe1 , '<STR_LIT>' ) <EOL> r1provides = getPerlProvides ( r1trv ) <EOL> self . assertEqual ( len ( r1provides ) , <NUM_LIT:5> ) <EOL> r2trv = self . build ( recipe2 , '<STR_LIT>' ) <EOL> r2provides = getPerlProvides ( r2trv ) <EOL> self . assertEqual ( len ( r2provides ) , <NUM_LIT:0> ) <EOL> self . assertTrue ( [ x for x in str ( r2trv . provides ( ) ) ] ) <EOL> self . cfg . enableRPMVersionDeps = True <EOL> r1trv = self . build ( recipe1 , '<STR_LIT>' ) <EOL> r1provides = getPerlProvides ( r1trv ) <EOL> self . assertEqual ( len ( r1provides ) , <NUM_LIT> ) <EOL> r2trv = self . build ( recipe2 , '<STR_LIT>' ) <EOL> r2provides = getPerlProvides ( r2trv ) <EOL> self . assertEqual ( len ( r2provides ) , <NUM_LIT:0> ) <EOL> self . assertTrue ( [ x for x in str ( r2trv . provides ( ) ) ] ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleKernelModMerging ( self ) : <EOL> '''<STR_LIT>''' <EOL> def checkDeps ( built , reqExpected , provExpected ) : <EOL> nvf = built <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> reqGot = list ( trv . requires ( ) . iterDepsByClass ( deps . RpmDependencies ) ) <EOL> provGot = list ( trv . provides ( ) . iterDepsByClass ( deps . RpmDependencies ) ) <EOL> self . assertEquals ( str ( reqGot ) , reqExpected ) <EOL> self . assertEquals ( str ( provGot ) , provExpected ) <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . cfg . enableRPMVersionDeps = False <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> req = "<STR_LIT>" <EOL> prov = "<STR_LIT>" <EOL> checkDeps ( built [ <NUM_LIT:0> ] , req , prov ) <EOL> self . cfg . enableRPMVersionDeps = True <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> req = "<STR_LIT>" <EOL> prov = "<STR_LIT>" <EOL> checkDeps ( built [ <NUM_LIT:0> ] , req , prov ) <EOL> recipestr2 = r"""<STR_LIT>""" <EOL> self . cfg . enableRPMVersionDeps = False <EOL> built , d = self . buildRecipe ( recipestr2 , "<STR_LIT>" ) <EOL> req = "<STR_LIT>" <EOL> prov = "<STR_LIT>" <EOL> checkDeps ( built [ <NUM_LIT:0> ] , req , prov ) <EOL> self . cfg . enableRPMVersionDeps = True <EOL> built , d = self . buildRecipe ( recipestr2 , "<STR_LIT>" ) <EOL> req = "<STR_LIT>" <EOL> prov = '<STR_LIT>' % '<STR_LIT:U+002CU+0020>' . join ( [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] ) <EOL> checkDeps ( built [ <NUM_LIT:0> ] , req , prov ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleDepCulling ( self ) : <EOL> """<STR_LIT>""" <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . cfg . enableRPMVersionDeps = False <EOL> self . overrideBuildFlavor ( '<STR_LIT>' ) <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> reqGot = list ( trv . requires ( ) . iterDepsByClass ( deps . RpmDependencies ) ) <EOL> reqExpected = "<STR_LIT>" <EOL> self . assertEquals ( str ( reqGot ) , reqExpected ) <EOL> self . cfg . enableRPMVersionDeps = True <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> reqGot = list ( trv . requires ( ) . iterDepsByClass ( deps . RpmDependencies ) ) <EOL> reqExpected = "<STR_LIT>" <EOL> self . assertEquals ( str ( reqGot ) , reqExpected ) <EOL> @ conary_test . rpm <EOL> def testRPMRequiresExceptions ( self ) : <EOL> """<STR_LIT>""" <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . overrideBuildFlavor ( '<STR_LIT>' ) <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> reqGot = list ( trv . requires ( ) . iterDepsByClass ( deps . RpmDependencies ) ) <EOL> reqExpected = "<STR_LIT>" <EOL> self . assertEquals ( str ( reqGot ) , reqExpected ) <EOL> @ conary_test . rpm <EOL> def testRPMRequiresExceptDeps1 ( self ) : <EOL> """<STR_LIT>""" <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . overrideBuildFlavor ( '<STR_LIT>' ) <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> reqGot = list ( trv . requires ( ) . iterDepsByClass ( deps . RpmLibDependencies ) ) <EOL> reqExpected = "<STR_LIT>" <EOL> self . assertEquals ( str ( reqGot ) , reqExpected ) <EOL> @ conary_test . rpm <EOL> def testRPMRequiresExceptDeps2 ( self ) : <EOL> """<STR_LIT>""" <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . overrideBuildFlavor ( '<STR_LIT>' ) <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> reqGot = list ( trv . requires ( ) . iterDepsByClass ( deps . RpmLibDependencies ) ) <EOL> reqExpected = "<STR_LIT>" <EOL> self . assertEquals ( str ( reqGot ) , reqExpected ) <EOL> @ conary_test . rpm <EOL> def testRPMRequiresExceptDeps3 ( self ) : <EOL> """<STR_LIT>""" <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . overrideBuildFlavor ( '<STR_LIT>' ) <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> reqGot = list ( trv . requires ( ) . iterDepsByClass ( deps . RpmDependencies ) ) <EOL> reqExpected = "<STR_LIT>" <EOL> self . assertEquals ( str ( reqGot ) , reqExpected ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleUserGroup ( self ) : <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> nvf = built [ <NUM_LIT:0> ] <EOL> nvf = nvf [ <NUM_LIT:0> ] , versions . VersionFromString ( nvf [ <NUM_LIT:1> ] ) , nvf [ <NUM_LIT:2> ] <EOL> repos = self . openRepository ( ) <EOL> trv = repos . getTrove ( * nvf ) <EOL> self . assertEquals ( trv . requires ( ) , deps . ThawDependencySet ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleGhost ( self ) : <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> client = self . getConaryClient ( ) <EOL> repos = client . getRepos ( ) <EOL> nvf = repos . findTrove ( None , built [ <NUM_LIT:0> ] ) <EOL> trv = repos . getTrove ( * nvf [ <NUM_LIT:0> ] ) <EOL> fileList = list ( trv . iterFileList ( ) ) <EOL> fileObjs = repos . getFileVersions ( [ ( x [ <NUM_LIT:0> ] , x [ <NUM_LIT:2> ] , x [ <NUM_LIT:3> ] ) for x in fileList <EOL> if x [ <NUM_LIT:1> ] == '<STR_LIT>' ] ) <EOL> for fileInfo , fileObj in zip ( fileList , fileObjs ) : <EOL> self . assertFalse ( fileObj . flags . isConfig ( ) , <EOL> "<STR_LIT>" % fileInfo [ <NUM_LIT:1> ] ) <EOL> self . assertFalse ( fileObj . flags . isTransient ( ) , <EOL> "<STR_LIT>" % fileInfo [ <NUM_LIT:1> ] ) <EOL> self . assertTrue ( fileObj . flags . isInitialContents ( ) , <EOL> "<STR_LIT>" % fileInfo [ <NUM_LIT:1> ] ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleDeps ( self ) : <EOL> '<STR_LIT>' <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . cfg . enableRPMVersionDeps = False <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> client = self . getConaryClient ( ) <EOL> repos = client . getRepos ( ) <EOL> nvf = repos . findTrove ( None , built [ <NUM_LIT:0> ] ) <EOL> trv = repos . getTrove ( * nvf [ <NUM_LIT:0> ] ) <EOL> reqExpected = '<STR_LIT:\n>' . join ( ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) <EOL> provExpected = '<STR_LIT:\n>' . join ( ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) <EOL> self . assertEqual ( str ( trv . provides ( ) ) , provExpected ) <EOL> self . assertEqual ( str ( trv . requires ( ) ) , reqExpected ) <EOL> self . cfg . enableRPMVersionDeps = True <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> client = self . getConaryClient ( ) <EOL> repos = client . getRepos ( ) <EOL> nvf = repos . findTrove ( None , built [ <NUM_LIT:0> ] ) <EOL> trv = repos . getTrove ( * nvf [ <NUM_LIT:0> ] ) <EOL> reqExpected = '<STR_LIT:\n>' . join ( ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) <EOL> provExpected = '<STR_LIT:\n>' . join ( ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ) ) <EOL> self . assertEqual ( str ( trv . provides ( ) ) , provExpected ) <EOL> self . assertEqual ( str ( trv . requires ( ) ) , reqExpected ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleSharedDeps ( self ) : <EOL> '<STR_LIT>' <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> self . cfg . enableRPMVersionDeps = False <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> client = self . getConaryClient ( ) <EOL> repos = client . getRepos ( ) <EOL> reqExpected = '<STR_LIT:\n>' . join ( ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) ) <EOL> provExpectedTemplate = '<STR_LIT:\n>' . join ( ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) ) <EOL> for b in built : <EOL> nvf = repos . findTrove ( None , b ) <EOL> trv = repos . getTrove ( * nvf [ <NUM_LIT:0> ] ) <EOL> provExpected = provExpectedTemplate . replace ( '<STR_LIT>' , <EOL> b [ <NUM_LIT:0> ] . split ( '<STR_LIT::>' ) [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( str ( trv . provides ( ) ) , provExpected ) <EOL> self . assertEqual ( str ( trv . requires ( ) ) , reqExpected ) <EOL> self . cfg . enableRPMVersionDeps = True <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> client = self . getConaryClient ( ) <EOL> repos = client . getRepos ( ) <EOL> reqExpected = '<STR_LIT:\n>' . join ( ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) ) <EOL> provExpectedTemplate = '<STR_LIT:\n>' . join ( ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) ) <EOL> for b in built : <EOL> nvf = repos . findTrove ( None , b ) <EOL> trv = repos . getTrove ( * nvf [ <NUM_LIT:0> ] ) <EOL> provExpected = provExpectedTemplate . replace ( '<STR_LIT>' , <EOL> b [ <NUM_LIT:0> ] . split ( '<STR_LIT::>' ) [ <NUM_LIT:0> ] ) <EOL> self . assertEqual ( str ( trv . provides ( ) ) , provExpected ) <EOL> self . assertEqual ( str ( trv . requires ( ) ) , reqExpected ) <EOL> @ conary_test . rpm <EOL> def testNoCapsuleTags ( self ) : <EOL> '<STR_LIT>' <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) <EOL> client = self . getConaryClient ( ) <EOL> repos = client . getRepos ( ) <EOL> nvf = repos . findTrove ( None , built [ <NUM_LIT:0> ] ) <EOL> trv = repos . getTrove ( * nvf [ <NUM_LIT:0> ] ) <EOL> fileList = list ( trv . iterFileList ( ) ) <EOL> fileObjs = repos . getFileVersions ( [ ( x [ <NUM_LIT:0> ] , x [ <NUM_LIT:2> ] , x [ <NUM_LIT:3> ] ) <EOL> for x in fileList ] ) <EOL> fileObj = fileObjs [ <NUM_LIT:0> ] <EOL> self . assertEquals ( fileObj . tags , [ ] ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsuleKernelDeps ( self ) : <EOL> '''<STR_LIT>''' <EOL> fPath = os . path . join ( resources . get_archive ( ) , <EOL> '<STR_LIT>' ) <EOL> def mockGet ( self , item , default ) : <EOL> if item == rpmhelper . PROVIDENAME or item == rpmhelper . REQUIRENAME : <EOL> return [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> if item == rpmhelper . PROVIDEVERSION or item == rpmhelper . REQUIREVERSION : <EOL> return [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> self . mock ( rpmhelper . _RpmHeader , '<STR_LIT>' , mockGet ) <EOL> h = rpmhelper . readHeader ( file ( fPath ) ) <EOL> ( req , prov ) , output = self . captureOutput ( h . getDeps ) <EOL> expected = '<STR_LIT:\n>' . join ( ( <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) ) <EOL> self . assertEqual ( str ( req ) , expected ) <EOL> self . assertEqual ( str ( prov ) , expected ) <EOL> self . assertEqual ( len ( output . strip ( ) . split ( '<STR_LIT:\n>' ) ) , <NUM_LIT:4> ) <EOL> ( req , prov ) , output = self . captureOutput ( h . getDeps , <EOL> mergeKmodSymbols = True ) <EOL> expected = '<STR_LIT:\n>' . join ( ( <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) ) <EOL> self . assertEqual ( str ( req ) , expected ) <EOL> self . assertEqual ( str ( prov ) , expected ) <EOL> self . assertEqual ( len ( output . strip ( ) . split ( '<STR_LIT:\n>' ) ) , <NUM_LIT:4> ) <EOL> @ conary_test . rpm <EOL> def testRemoveCapsuleFiles ( self ) : <EOL> """<STR_LIT>""" <EOL> recipe1 = """<STR_LIT>""" <EOL> recipe2 = ( recipe1 + "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> trv = self . build ( recipe1 , '<STR_LIT>' ) <EOL> files1 = [ x [ <NUM_LIT:1> ] for x in trv . iterFileList ( ) ] <EOL> self . assertTrue ( '<STR_LIT>' in files1 ) <EOL> assert ( trv . provides . getDepClasses ( ) [ deps . DEP_CLASS_FILES ] . hasDep ( '<STR_LIT>' ) ) <EOL> trv2 = self . build ( recipe2 , '<STR_LIT>' ) <EOL> files2 = [ x [ <NUM_LIT:1> ] for x in trv2 . iterFileList ( ) ] <EOL> self . assertTrue ( '<STR_LIT>' not in files2 ) <EOL> assert ( deps . DEP_CLASS_FILES not in trv2 . provides . getDepClasses ( ) ) <EOL> recipe3 = ( recipe1 + "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> e = self . assertRaises ( PolicyError , self . build , recipe3 , '<STR_LIT>' ) <EOL> self . assertEquals ( str ( e ) , <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> @ conary_test . rpm <EOL> def testRemoveCapsuleFilesNoFileProvide ( self ) : <EOL> """<STR_LIT>""" <EOL> recipe1 = """<STR_LIT>""" <EOL> trv = self . build ( recipe1 , '<STR_LIT>' ) <EOL> files1 = [ x [ <NUM_LIT:1> ] for x in trv . iterFileList ( ) ] <EOL> self . assertTrue ( '<STR_LIT>' not in files1 ) <EOL> @ conary_test . rpm <EOL> def testRPMCapsulePackageNoComponent ( self ) : <EOL> '''<STR_LIT>''' <EOL> recipestr1 = r"""<STR_LIT>""" <EOL> built , d = self . buildRecipe ( recipestr1 , "<STR_LIT>" ) </s>
