Coverage for src/robotide/contrib/testrunner/SettingsParser.py: 88%
13 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-06 10:40 +0100
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-06 10:40 +0100
1# Copyright 2010 Orbitz WorldWide
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
15# Modified by NSN
16# Copyright 2010-2012 Nokia Solutions and Networks
17# Copyright 2013-2015 Nokia Networks
18# Copyright 2016- Robot Framework Foundation
19#
20# Licensed under the Apache License, Version 2.0 (the "License");
21# you may not use this file except in compliance with the License.
22# You may obtain a copy of the License at
23#
24# http://www.apache.org/licenses/LICENSE-2.0
25#
26# Unless required by applicable law or agreed to in writing, software
27# distributed under the License is distributed on an "AS IS" BASIS,
28# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29# See the License for the specific language governing permissions and
30# limitations under the License.
32class SettingsParser:
34 @staticmethod
35 def get_console_log_name(settings):
36 return SettingsParser._get_settings_value('console_log_name', settings) 1ac
38 @staticmethod
39 def _get_settings_value(name, source, default=''):
40 if name in source: 1ac
41 switch = name 1a
42 else:
43 return default 1c
44 i = source.index(switch) 1a
45 if len(source) == i: 45 ↛ 46line 45 didn't jump to line 46 because the condition on line 45 was never true1a
46 return default
47 return source[i + 1] 1a