Пример #1
0
 def test_get_osfamily(self):
     for distro_name in distro.DISTRO_NAMES:
         self.mock_os_release.return_value = {'ID': distro_name}
         variant = distro.name_to_distro(distro_name)
         family = distro.DISTRO_TO_OSFAMILY[variant]
         distro_obj = distro.get_osfamily()
         self.assertEqual(family, distro_obj)
Пример #2
0
 def test_get_distro(self):
     for distro_name in distro.DISTRO_NAMES:
         self.mock_os_release.return_value = {'ID': distro_name}
         variant = distro.name_to_distro(distro_name)
         distro_obj = distro.get_distro()
         self.assertEqual(variant, distro_obj)
Пример #3
0
 def test_name_to_distro_unknown_value(self):
     with self.assertRaises(ValueError):
         distro.name_to_distro(None)
Пример #4
0
 def test_name_to_distro_unknown_attr(self):
     with self.assertRaises(ValueError):
         distro.name_to_distro('NotADistro')
Пример #5
0
 def test_name_to_distro(self):
     for distro_name in distro.DISTRO_NAMES:
         dobj = distro.name_to_distro(distro_name)
         self.assertEqual(dobj, getattr(distro.DISTROS, distro_name))