Robot Framework Integrated Development Environment (RIDE)
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 robotide.lib.robot.utils import py2to3
17 
18 from .visitor import SuiteVisitor
19 
20 
21 @py2to3
23 
24  def __init__(self, add=None, remove=None):
25  self.addadd = add
26  self.removeremove = remove
27 
28  def start_suite(self, suite):
29  return bool(self)
30 
31  def visit_test(self, test):
32  test.tags.add(self.addadd)
33  test.tags.remove(self.removeremove)
34 
35  def visit_keyword(self, keyword):
36  pass
37 
38  def __nonzero__(self):
39  return bool(self.add or self.remove)
def __init__(self, add=None, remove=None)
Definition: tagsetter.py:24
def visit_test(self, test)
Implements traversing through the test and its keywords.
Definition: tagsetter.py:31
def start_suite(self, suite)
Called when suite starts.
Definition: tagsetter.py:28
def visit_keyword(self, keyword)
Implements traversing through the keyword and its child keywords.
Definition: tagsetter.py:35
Interface to ease traversing through a test suite structure.
Definition: visitor.py:75