[tests] add unit tests for .spec parsers
This commit is contained in:
@@ -146,7 +146,11 @@ class SpecPreprocessor:
|
||||
if split_line:
|
||||
expander = self.__builtin_expanders.get(split_line[0])
|
||||
if expander is not None:
|
||||
line = expander(line)
|
||||
try:
|
||||
line = expander(line)
|
||||
except RuntimeError as err:
|
||||
raise SpecPreprocessor.PreprocessorError(
|
||||
"invalid preprocessor line: %s" % (err,))
|
||||
lines += line
|
||||
|
||||
return lines
|
||||
|
||||
@@ -7,11 +7,11 @@ import unittest
|
||||
sys.path.insert(0,'.')
|
||||
sys.path.insert(0,'..')
|
||||
|
||||
from tests import version, utils
|
||||
from tests import version, utils, specs, parsers
|
||||
rc = 0
|
||||
|
||||
# Add to the list the module to test
|
||||
mods = [version, utils]
|
||||
mods = [version, utils, specs, parsers]
|
||||
|
||||
tests = []
|
||||
for mod in mods:
|
||||
|
||||
@@ -18,6 +18,8 @@ class SpecsTest(unittest.TestCase):
|
||||
sys.stdout.write("%s ran\n" % (self,))
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
raise SystemExit(0)
|
||||
|
||||
@@ -5,6 +5,7 @@ sys.path.insert(0,'.')
|
||||
sys.path.insert(0,'..')
|
||||
import unittest
|
||||
import tempfile
|
||||
|
||||
from molecule.compat import get_stringtype
|
||||
from molecule.utils import md5sum, copy_dir, get_random_number, \
|
||||
remove_path_sandbox, remove_path, mkdtemp, empty_dir, \
|
||||
|
||||
@@ -3,6 +3,7 @@ import sys
|
||||
sys.path.insert(0,'.')
|
||||
sys.path.insert(0,'..')
|
||||
import unittest
|
||||
|
||||
from molecule.compat import get_stringtype
|
||||
|
||||
class VersionTest(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user