예제 #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
파일: test_config.py 프로젝트: whydoubt/dnf
 def test_ranges(self):
     conf = YumConf()
     with self.assertRaises(ValueError):
         conf.debuglevel = 11
예제 #5
0
파일: test_config.py 프로젝트: whydoubt/dnf
 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
파일: test_config.py 프로젝트: whydoubt/dnf
 def test_bugtracker(self):
     conf = YumConf()
     self.assertEqual(conf.bugtracker_url,
                      "https://bugzilla.redhat.com/enter_bug.cgi" +
                      "?product=Fedora&component=dnf")