Skip to content
Snippets Groups Projects

eu-xfsc-bddV0.0.4

Merged Andrei Danciuc requested to merge eu-xfsc-bddV0.0.4 into main
3 files
+ 72
8
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -4,6 +4,8 @@ Validate bash commands results
from typing import Any, Callable, Iterable
# pylint: disable=missing-function-docstring
import os
import re
from dataclasses import dataclass
from behave import \
@@ -30,5 +32,40 @@ def assert_exists_alias(context: ContextType, alias: str) -> None:
@given("input Alias|Text|Description provided") # type: ignore[misc]
def add_alias_with_text_type_as_multiline_table(context: ContextType) -> None:
"""
Example::
Feature: Trust List Management
allow CRUD (create, read, update, delete) operations
on the trust list at the Trusted Data Store
Background:
Given TSPA Keycloak is up
And TSPA Server is up
And input Alias|Text|Description provided
| Alias | Text | Description |
| tf-domain-name | trust.train1.xfsc.dev | X_NAME:TRAIN_ENV:jenkins-train |
| storage | IPFS | X_NAME:TRAIN_ENV:jenkins-train |
| Storage | IPFS | X_NAME:TRAIN_ENV:jenkins-train |
| tf-domain-name | trust.train1.xfsc.dev | X_NAME:TRAIN_ENV:dev-use-train |
| storage | local | X_NAME:TRAIN_ENV:dev-use-train |
| Storage | Local | X_NAME:TRAIN_ENV:dev-use-train |
| tf-domain-name | x.y.z.de | X_NAME:TRAIN_ENV:dev-with-docker-compose |
| storage | local | X_NAME:TRAIN_ENV:dev-with-docker-compose |
| Storage | Local | X_NAME:TRAIN_ENV:dev-with-docker-compose |
"""
for row in context.table:
description: str = row['Description']
match = re.search(r":([A-Z0-9_]+_ENV):([^:]+)", description)
if match:
env_name = match.group(1)
parse_value = match.group(2)
env_value = os.environ[env_name]
if env_value != parse_value:
continue
context.aliases[row['Alias']] = row['Text'].format(**context.aliases)
Loading