Robot Framework Integrated Development Environment (RIDE)
defaults.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 
17 class TestDefaults():
18 
19  def __init__(self, settings, parent=None):
20  self.setupsetup = settings.test_setup
21  self.teardownteardown = settings.test_teardown
22  self.timeouttimeout = settings.test_timeout
23  self.force_tagsforce_tags = settings.force_tags
24  self.default_tagsdefault_tags = settings.default_tags
25  self.templatetemplate = settings.test_template
26  if parent:
27  self.setupsetup = self.setupsetup or parent.setup
28  self.teardownteardown = self.teardownteardown or parent.teardown
29  self.timeouttimeout = self.timeouttimeout or parent.timeout
30  self.force_tagsforce_tags += parent.force_tags
31 
32  def get_test_values(self, test):
33  return TestValues(test, self)
34 
35 
36 class TestValues():
37 
38  def __init__(self, test, defaults):
39  self.setupsetup = test.setup or defaults.setup
40  self.teardownteardown = test.teardown or defaults.teardown
41  self.timeouttimeout = test.timeout or defaults.timeout
42  self.templatetemplate = test.template or defaults.template
43  self.tagstags = (test.tags or defaults.default_tags) + defaults.force_tags
def __init__(self, settings, parent=None)
Definition: defaults.py:19
def __init__(self, test, defaults)
Definition: defaults.py:38