Esempio n. 1
0
 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'])
Esempio n. 2
0
 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)
Esempio n. 3
0
 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'])
Esempio n. 4
0
 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'])