Robot Framework
tagsetter.py
Go to the documentation of this file.
1 # Copyright 2008-2015 Nokia Networks
2 # Copyright 2016- Robot Framework Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 from .visitor import SuiteVisitor
17 
18 
20 
21  def __init__(self, add=None, remove=None):
22  self.addadd = add
23  self.removeremove = remove
24 
25  def start_suite(self, suite):
26  return bool(self)
27 
28  def visit_test(self, test):
29  test.tags.add(self.addadd)
30  test.tags.remove(self.removeremove)
31 
32  def visit_keyword(self, keyword):
33  pass
34 
35  def __bool__(self):
36  return bool(self.add or self.remove)
def visit_test(self, test)
Implements traversing through tests.
Definition: tagsetter.py:28
def visit_keyword(self, keyword)
Implements traversing through keywords.
Definition: tagsetter.py:32
def __init__(self, add=None, remove=None)
Definition: tagsetter.py:21
def start_suite(self, suite)
Called when a suite starts.
Definition: tagsetter.py:25
Interface to ease traversing through a test suite structure.
Definition: visitor.py:85