Esempio n. 1
0
    def __init__(self, *args):
        support.TestCase.__init__(self, *args)
        self.base = support.MockBase()
        self.sack = self.base.sack

        # load the testing repo
        repo = support.MockRepo('drpm', '/tmp/dnf-cache')
        self.base.repos[repo.id] = repo
        repo.baseurl = ['file://%s/%s' % (support.repo_dir(), repo.id)]
        repo.load()

        # add it to sack
        hrepo = hawkey.Repo(repo.id)
        hrepo.repomd_fn = repo.repomd_fn
        hrepo.primary_fn = repo.primary_fn
        hrepo.filelists_fn = repo.filelists_fn
        hrepo.presto_fn = repo.presto_fn
        self.sack.load_yum_repo(hrepo, load_filelists=True, load_presto=True)
Esempio n. 2
0
def mock_sack_fn():
    return (lambda yumbase: support.TestSack(support.repo_dir(), yumbase))
Esempio n. 3
0
def mock_sack_fn():
    return (lambda base: support.TestSack(support.repo_dir(), base))