diff options
author | Lovett, Trevor <trevor.lovett@att.com> | 2019-12-03 15:18:03 -0600 |
---|---|---|
committer | Lovett, Trevor (tl2972) <tl2972@att.com> | 2019-12-04 14:03:02 -0600 |
commit | 079622e0b69ec1e5c50af08c8312937609929233 (patch) | |
tree | 617cad5ce13fa7f258cb054d5c0cf1cf37eb028c /ice_validator/tests/conftest.py | |
parent | 74436fb509d03ea56feb50afa083c9c393fd95c5 (diff) |
[VVP] Support pluggable data sources for preload data
Change-Id: Ia7fcfa25203a93eac93381f472e3ba1e6c11235f
Issue-ID: VVP-339
Signed-off-by: Lovett, Trevor <trevor.lovett@att.com>
Diffstat (limited to 'ice_validator/tests/conftest.py')
-rw-r--r-- | ice_validator/tests/conftest.py | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/ice_validator/tests/conftest.py b/ice_validator/tests/conftest.py index 9a839b5..e0aa864 100644 --- a/ice_validator/tests/conftest.py +++ b/ice_validator/tests/conftest.py @@ -44,8 +44,7 @@ import os import re import time -from preload.model import create_preloads -from config import get_generator_plugin_names +from preload.engine import PLUGIN_MGR, create_preloads from tests.helpers import get_output_dir try: @@ -830,20 +829,30 @@ def pytest_addoption(parser): ) parser.addoption( - "--env-directory", - dest="env_dir", - action="store", - help="optional directory of .env files for preload generation", - ) - - parser.addoption( "--preload-format", dest="preload_formats", action="append", help=( "Preload format to create (multiple allowed). If not provided " "then all available formats will be created: {}" - ).format(", ".join(get_generator_plugin_names())), + ).format(", ".join(g.format_name() for g in PLUGIN_MGR.preload_generators)), + ) + + parser.addoption( + "--preload-source-type", + dest="preload_source_type", + action="store", + default="envfiles", + help=( + "Preload source type to create (multiple allowed): {}" + ).format(", ".join(s.get_identifier() for s in PLUGIN_MGR.preload_sources)), + ) + + parser.addoption( + "--preload-source", + dest="preload_source", + action="store", + help="File or directory containing the source dat for the preloads", ) @@ -859,7 +868,8 @@ def pytest_configure(config): or config.getoption("self_test") or config.getoption("help") ): - raise Exception('One of "--template-dir" or' ' "--self-test" must be specified') + raise Exception('One of "--template-directory" or' + ' "--self-test" must be specified') def pytest_generate_tests(metafunc): |