env property fix for 1.x

adding environment for 2.x was causing fail for 1.x runs, so added condition
This commit is contained in:
Shivam Thakur
2021-08-07 18:52:52 +05:30
committed by GitHub
parent 55e8e528ed
commit bde892efc1

View File

@@ -661,16 +661,18 @@ def add_allure_environment_property(request: SubRequest) -> Optional[Callable]:
@fixture(scope='session')
def get_uc_ap_version(get_apnos, get_configuration):
version_list = []
for access_point_info in get_configuration['access_point']:
ap_ssh = get_apnos(access_point_info)
version = ap_ssh.get_ap_version_ucentral()
version_list.append(version)
yield version_list
if request.config.getoption("2.x"):
version_list = []
for access_point_info in get_configuration['access_point']:
ap_ssh = get_apnos(access_point_info)
version = ap_ssh.get_ap_version_ucentral()
version_list.append(version)
yield version_list
@fixture(scope='session')
def add_env_properties(get_configuration, get_uc_ap_version, add_allure_environment_property: Callable) -> None:
add_allure_environment_property('Access-Point-Model', get_configuration["access_point"][0]["model"])
add_allure_environment_property('Access-Point-Firmware-Version', get_uc_ap_version[0].split("\n")[1])
add_allure_environment_property('Cloud-Controller-SDK-URL', get_configuration["controller"]["url"])
if request.config.getoption("2.x"):
add_allure_environment_property('Access-Point-Model', get_configuration["access_point"][0]["model"])
add_allure_environment_property('Access-Point-Firmware-Version', get_uc_ap_version[0].split("\n")[1])
add_allure_environment_property('Cloud-Controller-SDK-URL', get_configuration["controller"]["url"])