Robot Framework
executionerrors.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
robot.model
import
ItemList, Message
17
from
robot.utils
import
setter
18
19
20
24
class
ExecutionErrors
:
25
id =
'errors'
26
27
def
__init__
(self, messages=None):
28
#: A :class:`list-like object <robot.model.itemlist.ItemList>` of
29
#: :class:`~robot.model.message.Message` instances.
30
self.
messages
messages
messages = messages
31
32
@setter
33
def
messages
(self, messages):
34
return
ItemList
(Message, {
'parent'
: self}, items=messages)
35
36
def
add
(self, other):
37
self.
messages
messages
messages.extend(other.messages)
38
39
def
visit
(self, visitor):
40
visitor.visit_errors(self)
41
42
def
__iter__
(self):
43
return
iter(self.
messages
messages
messages)
44
45
def
__len__
(self):
46
return
len(self.
messages
messages
messages)
47
48
def
__getitem__
(self, index):
49
return
self.
messages
messages
messages[index]
50
51
def
__str__
(self):
52
if
not
self:
53
return
'No execution errors'
54
if
len(self) == 1:
55
return
f
'Execution error: {self[0]}'
56
return
'\n'
.join([
'Execution errors:'
] + [
'- '
+ str(m)
for
m
in
self])
robot.model.itemlist.ItemList
Definition:
itemlist.py:23
robot.result.executionerrors.ExecutionErrors
Represents errors occurred during the execution of tests.
Definition:
executionerrors.py:24
robot.result.executionerrors.ExecutionErrors.messages
messages
Definition:
executionerrors.py:30
robot.result.executionerrors.ExecutionErrors.visit
def visit(self, visitor)
Definition:
executionerrors.py:39
robot.result.executionerrors.ExecutionErrors.__init__
def __init__(self, messages=None)
Definition:
executionerrors.py:27
robot.result.executionerrors.ExecutionErrors.messages
def messages(self, messages)
Definition:
executionerrors.py:33
robot.result.executionerrors.ExecutionErrors.__getitem__
def __getitem__(self, index)
Definition:
executionerrors.py:48
robot.result.executionerrors.ExecutionErrors.__len__
def __len__(self)
Definition:
executionerrors.py:45
robot.result.executionerrors.ExecutionErrors.__str__
def __str__(self)
Definition:
executionerrors.py:51
robot.result.executionerrors.ExecutionErrors.add
def add(self, other)
Definition:
executionerrors.py:36
robot.result.executionerrors.ExecutionErrors.__iter__
def __iter__(self)
Definition:
executionerrors.py:42
robot.model
Definition:
__init__.py:1
robot.utils
Definition:
__init__.py:1
src
robot
result
executionerrors.py
Generated by
1.9.1