mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00

Overview: 1) fixed up .gitignore file to use absolute paths (to project dir). 2) updated tox to run both manifest tests and flake8 3) updated yml file cause NULL for aws credentials causes an error on validation. 4) actually added the tests under tests/integration
39 lines
1 KiB
Python
39 lines
1 KiB
Python
import os
|
|
from nose.tools import assert_true
|
|
from bootstrapvz.base.manifest import Manifest
|
|
|
|
MANIFEST_DIR = os.path.join(
|
|
os.path.dirname(os.path.realpath(__file__)),
|
|
'../../manifests'
|
|
)
|
|
|
|
|
|
def test_manifest_generator():
|
|
"""
|
|
manifests_tests - test_manifest_generator.
|
|
|
|
Loops through the manifests directory and tests that
|
|
each file can successfully be loaded and validated.
|
|
"""
|
|
for fobj in os.listdir(MANIFEST_DIR):
|
|
path = os.path.join(os.path.abspath(MANIFEST_DIR), fobj)
|
|
|
|
yield validate_manifests, path
|
|
|
|
|
|
def validate_manifests(path):
|
|
"""
|
|
manifests_tests - validate_manifests.
|
|
|
|
Actually creates the manifest for a given path
|
|
and checks that all the data values have successfully
|
|
been created.
|
|
"""
|
|
manifest = Manifest(path)
|
|
|
|
assert_true(manifest.data)
|
|
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'])
|