def testSimple(self):
        r1 = self.addComponent('test:runtime', '1.0-1-1', fileContents = [], requires='trove: test:doc')
        r2 = self.addComponent('test:runtime', '2.0-1-1', fileContents = [], requires='soname: ELF32/foo.so.0(a b c) trove: test:doc')
        d1 = self.addComponent('test:doc', '1.0-1-1', filePrimer = 1)
        l1 = self.addComponent('test:lib', '1.0-1-1', filePrimer = 2,
                               provides='soname: ELF32/foo.so.0(a b c d)')

        db = database.Database(':memory:', ':memory:')
        db.addTrove(r1)

        repos = self.openRepository()
        relCs = repos.createChangeSet([ 
                    ('test:runtime', (r1.getVersion(), r1.getFlavor()),
                                     (r2.getVersion(), r2.getFlavor()),
                     False) ])

        absCs = repos.createChangeSet([ 
                    ('test:doc',     (None, None),
                                     (d1.getVersion(), d1.getFlavor()),
                     False),
                    ('test:lib',     (None, None),
                                     (l1.getVersion(), l1.getFlavor()),
                     False) ])

        trvSrc = ChangesetFilesTroveSource(db, storeDeps=True)
        trvSrc.addChangeSet(relCs)
        trvSrc.addChangeSet(absCs)

        for trv in (r2, d1, l1):
            [ otherTrv ] = trvSrc.getTroves([ (trv.getName(), trv.getVersion(),
                                               trv.getFlavor()) ], 
                                            withFiles = False)
            assert(trv == otherTrv)

        suggMap = trvSrc.resolveDependencies(None, [r2.getRequires(),
                                                    r1.getRequires()])
        assert(suggMap[r1.getRequires()] == [[(d1.getName(), d1.getVersion(), 
                                              d1.getFlavor())]])
        suggs = suggMap[r2.getRequires()]
        assert([(d1.getName(), d1.getVersion(), d1.getFlavor())] in suggs)
        assert([(l1.getName(), l1.getVersion(), l1.getFlavor())] in suggs)
dataset/ETHPy150Open sassoftware/conary/conary_test/repositorytest/trovesourcetest.py/ChangesetFilesTest.testSimple/original