예제 #1
0
    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)
예제 #2
0
파일: test_cli.py 프로젝트: hutarova/dnf
    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")
예제 #3
0
파일: test_cli.py 프로젝트: nphilipp/dnf
    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)
예제 #4
0
    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')
예제 #5
0
 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")
예제 #6
0
 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")
예제 #7
0
파일: test_cli.py 프로젝트: sourcejedi/dnf
    def test_installroot_configurable(self):
        """Test that conffile is detected in a new installroot."""

        conf = os.path.join(support.dnf_toplevel(),
                            "tests/etc/installroot.conf")
        self.cli.configure(
            ['-c', conf, '--nogpgcheck', '--releasever', '17', 'update'])
        self.assertEqual(self.base.conf.installroot, '/roots/dnf')
예제 #8
0
파일: test_cli.py 프로젝트: ryanuber/dnf
    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})
예제 #9
0
파일: test_cli.py 프로젝트: hutarova/dnf
    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}
        )
예제 #10
0
파일: test_config.py 프로젝트: edynox/dnf
 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)
예제 #11
0
 def test_conf_from_file(self):
     conf = Conf()
     # defaults
     self.assertFalse(conf.gpgcheck)
     self.assertEqual(conf.installonly_limit, 0)
     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)
예제 #12
0
    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
            })
예제 #13
0
파일: test_config.py 프로젝트: edynox/dnf
    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)
예제 #14
0
    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)
예제 #15
0
파일: test_cli.py 프로젝트: ryanuber/dnf
 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")
예제 #16
0
파일: test_repo.py 프로젝트: dmach/dnf
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),
예제 #17
0
 def test_toplevel(self):
     self.assertIn(support.dnf_toplevel(), sys.path)
예제 #18
0
 def test_toplevel(self):
     self.assertIn(support.dnf_toplevel(), sys.path)
예제 #19
0
파일: test_repo.py 프로젝트: yurchor/dnf
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),