#NEWLINE# def testGroupInfoRecipe( self ) : #NEWLINE# #INDENT# recipestr1 = "\nclass TestGroup(GroupInfoRecipe):\n    name = 'info-foo'\n    version = '1'\n    clearBuildReqs()\n    def setup(r):\n        r.macros.foo = 'foo'\n        r.Group('%(foo)s', 1000)\n" #NEWLINE# self . reset ( ) #NEWLINE# ( built , d ) = self . buildRecipe ( recipestr1 , 'TestGroup' ) #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' ] ) #NEWLINE# f . close ( ) #NEWLINE# f = file ( ( self . workDir + '/etc/group' ) ) #NEWLINE# assert ( f . readlines ( ) == [ 'root:*:0:root\n' , 'foo:*:1000:\n' ] ) #NEWLINE# f . close ( ) #NEWLINE# recipestr2 = "\nclass TestBadGroup(GroupInfoRecipe):\n    name = 'info-foo'\n    version = '1'\n    clearBuildReqs()\n    def setup(r):\n        r.Group('blah', 1000)\n" #NEWLINE# self . assertRaises ( usergroup . UserGroupError , self . buildRecipe , self , 'TestBadGroup' ) #NEWLINE# recipestr3 = "\nclass TestBad2Group(GroupInfoRecipe):\n    name = 'info-foo'\n    version = '1'\n    clearBuildReqs()\n    def setup(r):\n        r.Group('foo', 1000)\n        r.SupplementalGroup('foo', 'bar', 999)\n" #NEWLINE# self . assertRaises ( usergroup . UserGroupError , self . buildRecipe , recipestr3 , 'TestBad2Group' ) #NEWLINE# recipestr4 = "\nclass TestBad2Group(GroupInfoRecipe):\n    name = 'info-foo'\n    version = '1'\n    clearBuildReqs()\n    def setup(r):\n        r.Group('foo', 1000)\n        r.Group('foo', 999)\n" #NEWLINE# self . assertRaises ( usergroup . UserGroupError , self . buildRecipe , recipestr4 , 'TestBad2Group' )