示例#1
0
    def test_overrides(self):
        conf = YumConf()
        self.assertFalse(conf.assumeyes)
        self.assertFalse(conf.assumeno)
        self.assertEqual(conf.color_list_installed_older, 'bold')

        override = {'assumeyes': True, 'color_list_installed_older': 'timid'}
        conf.override(override)
        self.assertTrue(conf.assumeyes)
        self.assertFalse(conf.assumeno)  # no change
        self.assertEqual(conf.color_list_installed_older, 'timid')
示例#2
0
    def test_overrides(self):
        conf = YumConf()
        self.assertFalse(conf.assumeyes)
        self.assertFalse(conf.assumeno)
        self.assertEqual(conf.color_list_installed_older, 'bold')

        override = {'assumeyes': True,
                    'color_list_installed_older': 'timid'}
        conf.override(override)
        self.assertTrue(conf.assumeyes)
        self.assertFalse(conf.assumeno)  # no change
        self.assertEqual(conf.color_list_installed_older, 'timid')
示例#3
0
def main(args):
    try:
        with dnf.cli.cli.BaseCli(YumConf()) as base:
            return _main(base, args)
    except dnf.exceptions.ProcessLockError as e:
        logger.critical(e.value)
        show_lock_owner(e.pid)
        return 1
    except dnf.exceptions.LockError as e:
        logger.critical(e.value)
        return 1
    except dnf.exceptions.DepsolveError as e:
        return 1
    except dnf.exceptions.Error as e:
        return dnf.cli.main.ex_Error(e)
    except IOError as e:
        return dnf.cli.main.ex_IOError(e)
    except KeyboardInterrupt as e:
        logger.critical('{}: {}'.format(type(e).__name__, "Terminated."))
        return 1
示例#4
0
 def test_ranges(self):
     conf = YumConf()
     with self.assertRaises(ValueError):
         conf.debuglevel = 11
示例#5
0
 def test_prepend_installroot(self):
     conf = YumConf()
     conf.installroot = '/mnt/root'
     conf.prepend_installroot('persistdir')
     self.assertEqual(conf.persistdir, '/mnt/root/var/lib/dnf')
示例#6
0
 def test_bugtracker(self):
     conf = YumConf()
     self.assertEqual(conf.bugtracker_url,
                      "https://bugzilla.redhat.com/enter_bug.cgi" +
                      "?product=Fedora&component=dnf")