2016-03-03 23:56:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_manifest_generator():
|
2016-06-04 11:35:59 +02:00
|
|
|
"""
|
|
|
|
manifests_tests - test_manifest_generator.
|
2016-03-03 23:56:27 +01:00
|
|
|
|
2016-06-04 11:35:59 +02:00
|
|
|
Loops through the manifests directory and tests that
|
|
|
|
each file can successfully be loaded and validated.
|
|
|
|
"""
|
2016-03-03 23:56:27 +01:00
|
|
|
|
2016-06-04 11:35:59 +02:00
|
|
|
from bootstrapvz.base.manifest import Manifest
|
|
|
|
from bootstrapvz.base.main import run
|
2016-03-03 23:56:27 +01:00
|
|
|
|
2016-06-04 11:35:59 +02:00
|
|
|
def dry_run(path):
|
|
|
|
manifest = Manifest(path=path)
|
|
|
|
run(manifest, dry_run=True)
|
2016-03-03 23:56:27 +01:00
|
|
|
|
2016-06-04 11:35:59 +02:00
|
|
|
import os.path
|
|
|
|
from .. import recursive_glob
|
|
|
|
from itertools import chain
|
|
|
|
manifests = os.path.join(os.path.dirname(os.path.realpath(__file__)),
|
|
|
|
'../../manifests')
|
|
|
|
manifest_paths = chain(recursive_glob(manifests, '*.yml'), recursive_glob(manifests, '*.json'))
|
|
|
|
for manifest_path in manifest_paths:
|
|
|
|
dry_run.description = "Dry-running %s" % os.path.relpath(manifest_path, manifests)
|
|
|
|
yield dry_run, manifest_path
|