Fix unit testing, don't try parsing README.rst as manifest

This commit is contained in:
Anders Ingemann 2015-04-12 11:15:27 +02:00
parent f27d622e2c
commit 3e129b594b

View file

@ -1,12 +1,6 @@
import os
from nose.tools import assert_true from nose.tools import assert_true
from bootstrapvz.base.manifest import Manifest from bootstrapvz.base.manifest import Manifest
MANIFEST_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'../../manifests'
)
def test_manifest_generator(): def test_manifest_generator():
""" """
@ -15,10 +9,16 @@ def test_manifest_generator():
Loops through the manifests directory and tests that Loops through the manifests directory and tests that
each file can successfully be loaded and validated. each file can successfully be loaded and validated.
""" """
for fobj in os.listdir(MANIFEST_DIR): import os.path
path = os.path.join(os.path.abspath(MANIFEST_DIR), fobj) import glob
manifests = os.path.join(
yield validate_manifests, path os.path.dirname(os.path.realpath(__file__)),
'../../manifests'
)
for manifest_path in glob.glob(manifests + '/*.yml'):
yield validate_manifests, manifest_path
for manifest_path in glob.glob(manifests + '/*.json'):
yield validate_manifests, manifest_path
def validate_manifests(path): def validate_manifests(path):