def test_non_nones2dict(self): parser = YumOptionParser(self.yumbase) values = parser.parse_args(args=['-y', '--enableplugin=meter,maid'])[0] self.assertIsInstance(values, optparse.Values) dct = parser._non_nones2dict(values) self.assertTrue(dct['assumeyes']) self.assertItemsEqual(dct['enableplugins'], ['meter', 'maid'])
def test_simple(self): parser = YumOptionParser(self.yumbase) self.assertFalse(self.yumbase.conf.assumeyes) parser.setupYumConfig(args=['update', '-y']) self.assertTrue(self.yumbase.conf.assumeyes)
def test_nogpgcheck(self): parser = YumOptionParser(self.yumbase) del self.yumbase.repos # this doesn't try to access yumbase.repos: parser.setupYumConfig(args=['update', '--nogpgcheck'])
def test_non_nones2dict(self): parser = YumOptionParser(self.yumbase) (values, _) = parser.parse_args(args=['-y']) self.assertIsInstance(values, optparse.Values) dct = parser._non_nones2dict(values) self.assertTrue(dct['assumeyes'])