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
19
class
TagSetter
(
SuiteVisitor
):
20
21
def
__init__
(self, add=None, remove=None):
22
self.
add
add = add
23
self.
remove
remove = remove
24
25
def
start_suite
(self, suite):
26
return
bool(self)
27
28
def
visit_test
(self, test):
29
test.tags.add(self.
add
add)
30
test.tags.remove(self.
remove
remove)
31
32
def
visit_keyword
(self, keyword):
33
pass
34
35
def
__bool__
(self):
36
return
bool(self.add
or
self.remove)
robot.model.tagsetter.TagSetter
Definition:
tagsetter.py:19
robot.model.tagsetter.TagSetter.visit_test
def visit_test(self, test)
Implements traversing through tests.
Definition:
tagsetter.py:28
robot.model.tagsetter.TagSetter.visit_keyword
def visit_keyword(self, keyword)
Implements traversing through keywords.
Definition:
tagsetter.py:32
robot.model.tagsetter.TagSetter.__init__
def __init__(self, add=None, remove=None)
Definition:
tagsetter.py:21
robot.model.tagsetter.TagSetter.add
add
Definition:
tagsetter.py:22
robot.model.tagsetter.TagSetter.remove
remove
Definition:
tagsetter.py:23
robot.model.tagsetter.TagSetter.__bool__
def __bool__(self)
Definition:
tagsetter.py:35
robot.model.tagsetter.TagSetter.start_suite
def start_suite(self, suite)
Called when a suite starts.
Definition:
tagsetter.py:25
robot.model.visitor.SuiteVisitor
Interface to ease traversing through a test suite structure.
Definition:
visitor.py:85
src
robot
model
tagsetter.py
Generated by
1.9.1