#NEWLINE# def testSupplementalGroupInfoRecipe( self ) : #NEWLINE# #INDENT# recipestr0 = "\nclass TestSupplementalGroupUser(UserInfoRecipe):\n    clearBuildReqs()\n    name = 'info-bar'\n    version = '1'\n    def setup(r):\n        r.User('bar', 999)\n" #NEWLINE# recipestr1 = "\nclass TestSupplementalGroup(GroupInfoRecipe):\n    clearBuildReqs()\n    name = 'info-foo'\n    version = '1'\n    def setup(r):\n        r.macros.foo = 'foo'\n        r.macros.bar = 'bar'\n        r.SupplementalGroup('%(bar)s', '%(foo)s', 1000)\n" #NEWLINE# self . reset ( ) #NEWLINE# ( builtb , d ) = self . buildRecipe ( recipestr0 , 'TestSupplementalGroupUser' ) #NEWLINE# for p in builtb : #NEWLINE# #INDENT# self . updatePkg ( self . workDir , p [ 0 ] , p [ 1 ] ) #NEWLINE# #UNINDENT# ( built , d ) = self . buildRecipe ( recipestr1 , 'TestSupplementalGroup' ) #NEWLINE# for p in built : #NEWLINE# #INDENT# self . updatePkg ( self . workDir , p [ 0 ] , p [ 1 ] ) #NEWLINE# #UNINDENT# f = file ( ( self . workDir + '/etc/conary/groupinfo/foo' ) ) #NEWLINE# assert ( f . readlines ( ) == [ 'PREFERRED_GID=1000\n' , 'USER=bar\n' ] ) #NEWLINE# f . close ( ) #NEWLINE# f = file ( ( self . workDir + '/etc/group' ) ) #NEWLINE# assert ( f . readlines ( ) == [ 'root:*:0:root\n' , 'bar:*:999:\n' , 'foo:*:1000:bar\n' ] ) #NEWLINE# f . close ( ) #NEWLINE# self . resetWork ( ) #NEWLINE# for p in builtb : #NEWLINE# #INDENT# self . updatePkg ( self . workDir , p [ 0 ] , p [ 1 ] ) #NEWLINE# #UNINDENT# f = file ( ( self . workDir + '/etc/group' ) , 'a' ) #NEWLINE# f . write ( 'asdf:*:1000:\n' ) #NEWLINE# f . close ( ) #NEWLINE# for p in built : #NEWLINE# #INDENT# self . updatePkg ( self . workDir , built [ 0 ] , p [ 1 ] ) #NEWLINE# #UNINDENT# f = file ( ( self . workDir + '/etc/group' ) ) #NEWLINE# assert ( f . readlines ( ) == [ 'root:*:0:root\n' , 'foo:*:1:bar\n' , 'bar:*:999:\n' , 'asdf:*:1000:\n' ] )