mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Fix unit/manifests_tests
The manifest folder reordering into official/ and examples/ hid all of the manifests from that generator. recursive_glob has been introduced in order to be able to find all manifests.
This commit is contained in:
parent
4c9aaf2dba
commit
4a0c598b81
2 changed files with 35 additions and 28 deletions
|
@ -0,0 +1,9 @@
|
|||
|
||||
|
||||
# Snatched from: http://stackoverflow.com/a/2186565/339505
|
||||
def recursive_glob(path, pattern):
|
||||
import fnmatch
|
||||
import os
|
||||
for path, dirnames, filenames in os.walk(path):
|
||||
for filename in fnmatch.filter(filenames, pattern):
|
||||
yield os.path.join(path, filename)
|
|
@ -10,14 +10,12 @@ def test_manifest_generator():
|
|||
each file can successfully be loaded and validated.
|
||||
"""
|
||||
import os.path
|
||||
import glob
|
||||
manifests = os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)),
|
||||
'../../manifests'
|
||||
)
|
||||
for manifest_path in glob.glob(manifests + '/*.yml'):
|
||||
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 glob.glob(manifests + '/*.json'):
|
||||
for manifest_path in recursive_glob(manifests, '*.json'):
|
||||
yield validate_manifests, manifest_path
|
||||
|
||||
|
||||
|
@ -32,8 +30,8 @@ def validate_manifests(path):
|
|||
manifest = Manifest(path=path)
|
||||
|
||||
assert_true(manifest.data)
|
||||
assert_true(manifest.data['name'])
|
||||
assert_true(manifest.data['provider'])
|
||||
assert_true(manifest.data['bootstrapper'])
|
||||
assert_true(manifest.data['image'])
|
||||
assert_true(manifest.data['volume'])
|
||||
assert_true(manifest.data['system'])
|
||||
|
|
Loading…
Add table
Reference in a new issue