def setUpGroupOddities(self):
        def _commitRecipe(name, recipe, new=True):
            oldDir = os.getcwd()
            os.chdir(self.workDir)
            if new:
                self.newpkg(name)
            else:
                self.checkout(name)
            os.chdir(name)
            self.writeFile('%s.recipe' % name, recipe)
            if new:
                self.addfile(name % '%s.recipe')
            self.commit()
            os.chdir(oldDir)

        groupTrove = """
class GroupFoo(GroupRecipe):
    name = 'group-foo'
    version = '1.0'
    checkPathConflicts = False
    clearBuildRequires()

    imageGroup = False

    def setup(r):
        r.setLabelPath('localhost@rpl:linux', 'localhost@rpl:branch1')
        r.createGroup('group-bam')
        r.addTrove('test1')
        r.addTrove('test2:runtime', None, '!readline')
        r.addTrove('test2:runtime', None, 'readline')
        r.addTrove('test3', None, 'is:x86_64')
        r.addTrove('test4-on-branch', source='test4')
        r.addNewGroup('group-bam')
        r.addTrove('group-bar', ':branch2', groupName='group-bam')
        Use.readline.setPlatform(True)
"""

        groupTrove2 = """
class GroupBar(GroupRecipe):
    name = 'group-bar'
    version = '1.0'
    clearBuildRequires()

    imageGroup = False

    def setup(r):
        r.createGroup('group-bar2')
        r.addTrove('test5')
        r.addNewGroup('group-bar2')
        r.addTrove('test1:runtime', ':linux', groupName='group-bar2')
        Use.readline.setPlatform(True)
"""
        self.addTestPkg(1)
        self.cookTestPkg(1)
        self.addTestPkg(1, content="#changed")

        self.addTestPkg(2, flags='Use.readline')
        self.overrideBuildFlavor('!readline')
        self.cookTestPkg(2)
        self.overrideBuildFlavor('readline')
        self.cookTestPkg(2)

        self.addTestPkg(3, flags='Arch.x86')
        self.overrideBuildFlavor('is:x86_64')
        self.cookTestPkg(3)

        self.overrideBuildFlavor('is:x86')

        self.cfg.buildLabel = Label('localhost@rpl:branch1')
        self.addTestPkg(4, content='r.PackageSpec("test4-on-branch", ".*")')
        self.cookTestPkg(4)
        self.cfg.buildLabel = Label('localhost@rpl:branch2')
        self.addTestPkg(5)
        self.cookTestPkg(5)
        _commitRecipe('group-bar', groupTrove2)
        self.cookFromRepository('group-bar')

        self.cfg.buildLabel = Label('localhost@rpl:linux')
        _commitRecipe('group-foo', groupTrove)
        self.cookFromRepository('group-foo')

        # add a trove with just a source version 
        # and one with neither source nor binary
        groupTrove += '''
        r.addTrove('test6')
        r.addTrove('test7')
'''
        self.addTestPkg(6)
        _commitRecipe('group-foo', groupTrove, new=False)
dataset/ETHPy150Open sassoftware/conary/conary_test/repositorytest/trovesourcetest.py/TroveSourceTest.setUpGroupOddities/swapped operands of `%`