本文整理汇总了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")
开发者ID:hutarova,项目名称:dnf,代码行数:7,代码来源:test_cli.py
示例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)
开发者ID:nphilipp,项目名称:dnf,代码行数:7,代码来源:test_cli.py
示例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")
开发者ID:MattSturgeon,项目名称:dnf,代码行数:8,代码来源:test_cli.py
示例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})
开发者ID:ryanuber,项目名称:dnf,代码行数:10,代码来源:test_cli.py
示例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}
)
开发者ID:hutarova,项目名称:dnf,代码行数:10,代码来源:test_cli.py
示例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)
开发者ID:edynox,项目名称:dnf,代码行数:11,代码来源:test_config.py
示例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)
开发者ID:edynox,项目名称:dnf,代码行数:19,代码来源:test_config.py
示例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),
开发者ID:dmach,项目名称:dnf,代码行数:31,代码来源:test_repo.py
示例9: test_toplevel
def test_toplevel(self):
self.assertIn(support.dnf_toplevel(), sys.path)
开发者ID:Aftermath,项目名称:dnf,代码行数:2,代码来源:test_sanity.py
示例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")
开发者ID:ryanuber,项目名称:dnf,代码行数:4,代码来源:test_cli.py
注:本文中的tests.support.dnf_toplevel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论