def testGroupByDefault(self):
        # CNY-1476
        def fooVer():
            return [x.asString() for x in client.db.getTroveVersionList('group-foo')]

        for v in [1, 2]:
            self.addComponent('foo:lib', str(v), filePrimer=4*v)
            groupFooContents = ['foo:lib']
            if v == 2:
                self.addComponent('bar:lib', str(v), filePrimer=4*v+1)
                self.addCollection('bar', str(v), ['bar:lib'])
                groupFooContents.append('bar')
            self.addCollection('group-foo', str(v), groupFooContents)
            self.addCollection('group-dist', str(v), [('group-foo', False)])

        client = conaryclient.ConaryClient(self.cfg)

        # Install group-dist
        self.updatePkg('group-dist=1')
        # group-foo should not be installed since it's byDefault=False
        self.assertFalse(fooVer())

        # Install group-foo
        self.updatePkg('group-foo=1')
        self.assertEquals(fooVer(), ['/localhost@rpl:linux/1-1-1'])

        # run updateall
        self.captureOutput(self.updateAll)
        self.assertEquals(fooVer(), ['/localhost@rpl:linux/2-1-1'])

        # bar should be installed
        try:
            self.assertTrue(client.db.getTroveVersionList('bar'))
        except __HOLE__:
            raise testhelp.SkipTestException('CNY-1476 has to be fixed')
        else:
            raise Exception("Remove the SkipTestException")
dataset/ETHPy150Open sassoftware/conary/conary_test/updatetest.py/UpdateTest.testGroupByDefault