def testDontWalkReferencedImageGroups(self):
        self.addComponent('foo:runtime')
        self.addCollection('foo', strongList = ['foo:runtime'])
        self.addCollection('group-foo', strongList = ['foo'],
                imageGroup = True)
        recipeStr = """
class GroupUncooked(GroupRecipe):
    name = 'group-uncooked'
    version = '1'

    clearBuildRequires()
    imageGroup = True

    def setup(r):
        r.add('foo')
        r.add('group-foo')
        r.RecordPolicy(exceptions = 'group-foo')
"""
        policyStr = """
from conary.build import policy
class RecordPolicy(policy.ImageGroupEnforcementPolicy):
    def __init__(self, *args, **kwargs):
        self.outputFile = open('%s', 'w')
        policy.ImageGroupEnforcementPolicy.__init__(self, *args, **kwargs)

    def doTroveSet(self, troveSet):
        self.outputFile.write(str(troveSet) + '\\n')
        self.outputFile.flush()

    def __del__(self):
        self.outputFile.close()
"""
        outputDir = tempfile.mkdtemp()
        tmpDir = tempfile.mkdtemp()
        try:
            policyDirs = self.cfg.policyDirs
            self.cfg.policyDirs = [tmpDir]
            outputFile = os.path.join(outputDir, 'log.txt')
            self.registerPolicy(tmpDir, policyStr % outputFile)
            grp = self.build(recipeStr, "GroupUncooked")
            data = open(outputFile).read()
            self.assertFalse("group-foo" != data,
                    "this trove should not have been mentioned")
        finally:
            util.rmtree(tmpDir)
            util.rmtree(outputDir)
            self.cfg.policyDirs = policyDirs
dataset/ETHPy150Open sassoftware/conary/conary_test/cvctest/buildtest/grouppolicytest.py/ManagedPolicyTest.testDontWalkReferencedImageGroups/operator `in` -> `!=`