test and fixtures for Type.{required,optional}_parameters

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-07 22:32:55 +02:00
parent 0f9d71423a
commit 8d3cad1815
5 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,2 @@
optional1
optional2

View file

@ -0,0 +1,2 @@
required1
required2

View file

@ -61,6 +61,25 @@ class TypeTestCase(unittest.TestCase):
cdist_type = cdist.core.Type(base_path, '__without_explorers')
self.assertEqual(cdist_type.explorers, [])
def test_with_required_parameters(self):
base_path = fixtures
cdist_type = cdist.core.Type(base_path, '__with_required_parameters')
self.assertEqual(cdist_type.required_parameters, ['required1', 'required2'])
def test_without_required_parameters(self):
base_path = fixtures
cdist_type = cdist.core.Type(base_path, '__without_required_parameters')
self.assertEqual(cdist_type.required_parameters, [])
def test_with_optional_parameters(self):
base_path = fixtures
cdist_type = cdist.core.Type(base_path, '__with_optional_parameters')
self.assertEqual(cdist_type.optional_parameters, ['optional1', 'optional2'])
def test_without_optional_parameters(self):
base_path = fixtures
cdist_type = cdist.core.Type(base_path, '__without_optional_parameters')
self.assertEqual(cdist_type.optional_parameters, [])
'''
suite = unittest.TestLoader().loadTestsFromTestCase(ObjectTestCase)