本文整理汇总了Python中tests.support.dnf_toplevel函数的典型用法代码示例。如果您正苦于以下问题:Python dnf_toplevel函数的具体用法?Python dnf_toplevel怎么用?Python dnf_toplevel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dnf_toplevel函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_installroot_configurable
def test_installroot_configurable(self):
"""Test that conffile is detected in a new installroot."""
self.cli.base.basecmd = "update"
conf = os.path.join(support.dnf_toplevel(), "tests/etc/installroot.conf")
self.cli.configure(["-c", conf, "--releasever", "17", "update"])
self.assertEqual(self.base.conf.installroot, "/roots/dnf")
示例2: test_installroot_with_etc
def test_installroot_with_etc(self):
"""Test that conffile is detected in a new installroot."""
self.cli.base.extcmds = []
tlv = support.dnf_toplevel()
self.cli.configure(['--installroot', tlv, 'update'])
self.assertEqual(self.base.conf.config_file_path, '%s/etc/dnf/dnf.conf' % tlv)
示例3: setUp
def setUp(self):
self.base = support.MockBase("main")
self.base._conf = dnf.conf.Conf()
self.base.output = support.MockOutput()
self.base.plugins = mock.Mock()
self.cli = dnf.cli.cli.Cli(self.base)
self.cli.command = mock.Mock()
self.conffile = os.path.join(support.dnf_toplevel(), "etc/dnf/dnf.conf")
示例4: test_installroot_with_etc
def test_installroot_with_etc(self, read_conf_file):
"""Test that conffile is detected in a new installroot."""
self.cli.base.basecmd = 'update'
tlv = support.dnf_toplevel()
self.cli.configure(['--installroot', tlv, 'update'])
read_conf_file.assert_called_with(
'%s/etc/dnf/dnf.conf' % tlv, tlv, None,
{'conffile': '%s/etc/dnf/dnf.conf' % tlv,
'installroot': tlv})
示例5: test_installroot_with_etc
def test_installroot_with_etc(self, read_conf_file):
"""Test that conffile is detected in a new installroot."""
self.cli.base.basecmd = "update"
self.cli.base.extcmds = []
tlv = support.dnf_toplevel()
self.cli.configure(["--installroot", tlv, "update"])
read_conf_file.assert_called_with(
"%s/etc/dnf/dnf.conf" % tlv, tlv, None, {"conffile": "%s/etc/dnf/dnf.conf" % tlv, "installroot": tlv}
)
示例6: test_conf_from_file
def test_conf_from_file(self):
conf = Conf()
# defaults
self.assertFalse(conf.gpgcheck)
self.assertEqual(conf.installonly_limit, 3)
self.assertTrue(conf.clean_requirements_on_remove)
conf.config_file_path = '%s/etc/dnf/dnf.conf' % support.dnf_toplevel()
conf.read(priority=dnf.conf.PRIO_MAINCONFIG)
self.assertTrue(conf.gpgcheck)
self.assertEqual(conf.installonly_limit, 3)
self.assertTrue(conf.clean_requirements_on_remove)
示例7: test_order_insensitive
def test_order_insensitive(self):
conf = Conf()
conf.config_file_path = '%s/etc/dnf/dnf.conf' % support.dnf_toplevel()
opts = argparse.Namespace(gpgcheck=False,
main_setopts=argparse.Namespace(installonly_limit=5))
# read config
conf.read(priority=dnf.conf.PRIO_MAINCONFIG)
# update from commandline
conf._configure_from_options(opts)
self.assertFalse(conf.gpgcheck)
self.assertEqual(conf.installonly_limit, 5)
# and the other way round should have the same result
# update from commandline
conf._configure_from_options(opts)
# read config
conf.read(priority=dnf.conf.PRIO_MAINCONFIG)
self.assertFalse(conf.gpgcheck)
self.assertEqual(conf.installonly_limit, 5)
示例8: RepoFunctionsTest
from tests.support import mock
import dnf.callback
import dnf.drpm
import dnf.repo
import dnf.util
import dnf.exceptions
import iniparse.compat
import io
import librepo
import os
import re
import tempfile
import unittest
REPOS = "%s/tests/repos" % support.dnf_toplevel()
BASEURL = "file://%s/rpm" % REPOS
TOUR_CHKSUM = """\
ce77c1e5694b037b6687cf0ab812ca60431ec0b65116abbb7b82684f0b092d62"""
class RepoFunctionsTest(unittest.TestCase):
def test_cachedir_re(self):
pairs = [
('fedora-fe3d2f0c91e9b65c', 'fedora'),
('foo-bar-eb0d6f10ccbdafba', 'foo-bar'),
('a%^&$b-fe3d2f0c91e9b65c', None),
('fedora-91e9b65c', None),
('fedora-xe3d2f0c91e9b65c', None),
('-fe3d2f0c91e9b65c', None),
('fedorafe3d2f0c91e9b65c', None),
示例9: test_toplevel
def test_toplevel(self):
self.assertIn(support.dnf_toplevel(), sys.path)
示例10: setUp
def setUp(self):
self.yumbase = support.MockYumBase("main")
self.cli = dnf.cli.cli.Cli(self.yumbase)
self.conffile = os.path.join(support.dnf_toplevel(), "etc/dnf/dnf.conf")