in behave you can specfy tags like:
--tags foo,bar --tags baz
I will call --tags foo,bar as a tag set what behave does is that it:
takes tag one by on in each set and if any of tag is in (is not for ~ negtion) tags for feature/scenatio its considers set to pass
if all set passes test is executed
code is:
def check(self, tags):
"""
Checks if this tag expression matches the tags of a model element.
:param tags: List of tags of a model element.
:return: True, if tag expression matches. False, otherwise.
"""
if not self.ands:
return True
element_tags = set(tags)
def test_tag(xtag):
if xtag.startswith('-'): # -- or xtag.startswith('~'):
#print("debug")
#print("%s --- %s" %(xtag[1:],element_tags))
#print("result %s" %( xtag[1:] not in element_tags))
return xtag[1:] not in element_tags
return xtag in element_tags
# -- EVALUATE: (or_expr1) and (or_expr2) and ...
return all(any(test_tag(xtag) for xtag in ors) for ors in self.ands)
my tags works:
- specifing product and version tags (eap, eap6.4)
- specifing optional openshift tag