On Tue, Jul 23, 2013 at 3:04 PM, Helga Velroyen <hel...@google.com> wrote: > This patch adds some unit tests to ensure the consistency > of various constants regarding disk templates. > > Signed-off-by: Helga Velroyen <hel...@google.com> > --- > test/py/ganeti.constants_unittest.py | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/test/py/ganeti.constants_unittest.py > b/test/py/ganeti.constants_unittest.py > index 0e21feb..75a4292 100755 > --- a/test/py/ganeti.constants_unittest.py > +++ b/test/py/ganeti.constants_unittest.py > @@ -156,6 +156,17 @@ class TestConfdConstants(unittest.TestCase): > self.assertFalse(utils.FindDuplicates(constants.CONFD_REPL_STATUSES), > msg="Duplicated confd reply status code") > > +class TestDiskTemplateConstants(unittest.TestCase): > + > + def testPreference(self): > + self.assertEqual(set(constants.DISK_TEMPLATE_PREFERENCE), > + set(constants.DISK_TEMPLATES)) > + > + def testMapToStorageTypes(self): > + for disk_template in constants.DISK_TEMPLATES: > + self.assertTrue( > + constants.MAP_DISK_TEMPLATE_STORAGE_TYPE[disk_template] != None) > +
Should we use assertIsNotNone(x) ? Thanks, Guido