Robot Framework Integrated Development Environment (RIDE)
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 robotide.lib.robot.model import ItemList
17 from robotide.lib.robot.utils import setter
18 
19 from .model import Message
20 
21 
22 
27  message_class = Message
28 
29  def __init__(self, messages=None):
30  #: A :class:`list-like object <robot.model.itemlist.ItemList>` of
31  #: :class:`~robot.model.message.Message` instances.
32  self.messagesmessagesmessages = messages
33 
34  @setter
35  def messages(self, msgs):
36  return ItemList(self.message_classmessage_class, items=msgs)
37 
38  def add(self, other):
39  self.messagesmessagesmessages.extend(other.messages)
40 
41  def visit(self, visitor):
42  visitor.visit_errors(self)
43 
44  def __iter__(self):
45  return iter(self.messagesmessagesmessages)
46 
47  def __len__(self):
48  return len(self.messagesmessagesmessages)
49 
50  def __getitem__(self, index):
51  return self.messagesmessagesmessages[index]
Represents errors occurred during the execution of tests.