2014-04-30 14:49:26 -05:00
|
|
|
from nose.tools import assert_true
|
|
|
|
from bootstrapvz.base.manifest import Manifest
|
|
|
|
|
|
|
|
|
|
|
|
def test_manifest_generator():
|
2016-03-04 00:32:48 +01:00
|
|
|
"""
|
|
|
|
manifests_tests - test_manifest_generator.
|
2014-04-30 14:49:26 -05:00
|
|
|
|
2016-03-04 00:32:48 +01:00
|
|
|
Loops through the manifests directory and tests that
|
|
|
|
each file can successfully be loaded and validated.
|
|
|
|
"""
|
|
|
|
import os.path
|
|
|
|
from .. import recursive_glob
|
|
|
|
manifests = os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
|
|
|
'../../manifests')
|
|
|
|
for manifest_path in recursive_glob(manifests, '*.yml'):
|
|
|
|
yield validate_manifests, manifest_path
|
|
|
|
for manifest_path in recursive_glob(manifests, '*.json'):
|
|
|
|
yield validate_manifests, manifest_path
|
2014-04-30 14:49:26 -05:00
|
|
|
|
|
|
|
|
|
|
|
def validate_manifests(path):
|
2016-03-04 00:32:48 +01:00
|
|
|
"""
|
|
|
|
manifests_tests - validate_manifests.
|
2014-04-30 14:49:26 -05:00
|
|
|
|
2016-03-04 00:32:48 +01:00
|
|
|
Actually creates the manifest for a given path
|
|
|
|
and checks that all the data values have successfully
|
|
|
|
been created.
|
|
|
|
"""
|
|
|
|
manifest = Manifest(path=path)
|
2014-04-30 14:49:26 -05:00
|
|
|
|
2016-03-04 00:32:48 +01:00
|
|
|
assert_true(manifest.data)
|
|
|
|
assert_true(manifest.data['name'])
|
|
|
|
assert_true(manifest.data['provider'])
|
|
|
|
assert_true(manifest.data['bootstrapper'])
|
|
|
|
assert_true(manifest.data['volume'])
|
|
|
|
assert_true(manifest.data['system'])
|