test and fixtures for Type.list_*
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
5d59102018
commit
f46344effe
4 changed files with 14 additions and 0 deletions
0
lib/cdist/test/type/fixtures/list_types/__first/.keep
Normal file
0
lib/cdist/test/type/fixtures/list_types/__first/.keep
Normal file
0
lib/cdist/test/type/fixtures/list_types/__second/.keep
Normal file
0
lib/cdist/test/type/fixtures/list_types/__second/.keep
Normal file
0
lib/cdist/test/type/fixtures/list_types/__third/.keep
Normal file
0
lib/cdist/test/type/fixtures/list_types/__third/.keep
Normal file
|
@ -31,6 +31,20 @@ fixtures = op.join(my_dir, 'fixtures')
|
||||||
|
|
||||||
class TypeTestCase(unittest.TestCase):
|
class TypeTestCase(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_list_type_names(self):
|
||||||
|
base_path = op.join(fixtures, 'list_types')
|
||||||
|
type_names = cdist.core.Type.list_type_names(base_path)
|
||||||
|
self.assertEqual(type_names, ['__first', '__second', '__third'])
|
||||||
|
|
||||||
|
def test_list_types(self):
|
||||||
|
base_path = op.join(fixtures, 'list_types')
|
||||||
|
types = list(cdist.core.Type.list_types(base_path))
|
||||||
|
types_expected = [
|
||||||
|
cdist.core.Type(base_path, '__first'),
|
||||||
|
cdist.core.Type(base_path, '__second'),
|
||||||
|
cdist.core.Type(base_path, '__third'),
|
||||||
|
]
|
||||||
|
self.assertEqual(types, types_expected)
|
||||||
|
|
||||||
def test_only_one_instance(self):
|
def test_only_one_instance(self):
|
||||||
base_path = fixtures
|
base_path = fixtures
|
||||||
|
|
Loading…
Reference in a new issue