aboutsummaryrefslogtreecommitdiffstats
path: root/hdv/redfish/conftest.py
diff options
context:
space:
mode:
authorShubham Mishra <shivam828787@gmail.com>2020-07-22 15:56:25 +0530
committerShubham Mishra <shivam828787@gmail.com>2020-08-25 21:54:25 +0530
commitdcdd46fe975c13c56a246ba0a6c79516a6afda77 (patch)
tree3a45f7cdf9a8b14c4c1dba63058ea108d9d48dc1 /hdv/redfish/conftest.py
parent1bf4bd7a74febb5f837f606940a17c48530eebbd (diff)
add pytest for main engine and integrated testapi
Change-Id: I9fffd0e04758ddbd0fd05a6358dd4e162c9c8e05 Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
Diffstat (limited to 'hdv/redfish/conftest.py')
-rw-r--r--hdv/redfish/conftest.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/hdv/redfish/conftest.py b/hdv/redfish/conftest.py
new file mode 100644
index 0000000..9bc7bcb
--- /dev/null
+++ b/hdv/redfish/conftest.py
@@ -0,0 +1,19 @@
+import pytest
+from hdv_redfish import read_yaml
+
+def pytest_addoption(parser):
+ parser.addoption(
+ "--cases", action="store", default="./conf/cases.yaml", help="case yaml file"
+ )
+ parser.addoption(
+ "--config", action="store", default="./conf/config.yaml", help="given global config.yaml file"
+ )
+
+@pytest.fixture(scope = 'session')
+def conf_file(request):
+ return request.config.getoption("--config")
+
+def pytest_generate_tests(metafunc):
+ if "case" in metafunc.fixturenames:
+ cases_file = metafunc.config.getoption("--cases")
+ metafunc.parametrize("case", read_yaml(cases_file)) \ No newline at end of file