Coverage for pyDummy/__init__.py: 92%

40 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-06 08:37 +0000

1# ==================================================================================================================== # 

2# _____ _ _ _ _ _ # 

3# _ __ _ |_ _|__ ___ | (_)_ __ __ _ / \ ___| |_(_) ___ _ __ ___ # 

4# | '_ \| | | || |/ _ \ / _ \| | | '_ \ / _` | / _ \ / __| __| |/ _ \| '_ \/ __| # 

5# | |_) | |_| || | (_) | (_) | | | | | | (_| |_ / ___ \ (__| |_| | (_) | | | \__ \ # 

6# | .__/ \__, ||_|\___/ \___/|_|_|_| |_|\__, (_)_/ \_\___|\__|_|\___/|_| |_|___/ # 

7# |_| |___/ |___/ # 

8# ==================================================================================================================== # 

9# Authors: # 

10# Patrick Lehmann # 

11# # 

12# License: # 

13# ==================================================================================================================== # 

14# Copyright 2017-2024 Patrick Lehmann - Bötzingen, Germany # 

15# # 

16# Licensed under the Apache License, Version 2.0 (the "License"); # 

17# you may not use this file except in compliance with the License. # 

18# You may obtain a copy of the License at # 

19# # 

20# http://www.apache.org/licenses/LICENSE-2.0 # 

21# # 

22# Unless required by applicable law or agreed to in writing, software # 

23# distributed under the License is distributed on an "AS IS" BASIS, # 

24# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # 

25# See the License for the specific language governing permissions and # 

26# limitations under the License. # 

27# # 

28# SPDX-License-Identifier: Apache-2.0 # 

29# ==================================================================================================================== # 

30# 

31""" 

32A module for a set of dummy classes. 

33""" 

34 

35__author__ = "Patrick Lehmann" 

36__email__ = "Paebbels@gmail.com" 

37__copyright__ = "2017-2024, Patrick Lehmann" 

38__license__ = "Apache License, Version 2.0" 

39__version__ = "0.4.4" 

40__keywords__ = ["GitHub Actions"] 

41__issue_tracker__ = "https://GitHub.com/pyTooling/Actions/issues" 

42 

43from pyTooling.Decorators import export, readonly 

44from pyTooling.Platform import Platform 

45 

46 

47@export 

48class Base: 

49 """ 

50 A base-class for dummy applications. 

51 """ 

52 

53 _value: int #: An internal value. 

54 

55 def __init__(self) -> None: 

56 """ 

57 Initializes the base-class. 

58 """ 

59 self._value = 0 

60 

61 @readonly 

62 def Value(self) -> int: 

63 """ 

64 Read-only property to return the internal value. 

65 

66 :return: Internal value. 

67 """ 

68 return self._value 

69 

70 

71@export 

72class Application(Base): 

73 """ 

74 A dummy application for demonstration purposes. 

75 """ 

76 

77 def __init__(self) -> None: 

78 """ 

79 Initializes the dummy application. 

80 """ 

81 super().__init__() 

82 

83 platform = Platform() 

84 if platform.IsNativeLinux: 

85 self._value += 1 

86 elif platform.IsNativeMacOS: 

87 self._value += 2 

88 elif platform.IsNativeWindows: 

89 self._value += 3 

90 elif platform.IsMSYSOnWindows: 90 ↛ 91line 90 didn't jump to line 91 because the condition on line 90 was never true

91 self._value += 11 

92 elif platform.IsMinGW32OnWindows: 

93 self._value += 12 

94 elif platform.IsMinGW64OnWindows: 

95 self._value += 13 

96 elif platform.IsUCRT64OnWindows: 

97 self._value += 14 

98 elif platform.IsClang32OnWindows: 98 ↛ 99line 98 didn't jump to line 99 because the condition on line 98 was never true

99 self._value += 15 

100 elif platform.IsClang64OnWindows: 100 ↛ exitline 100 didn't return from function '__init__' because the condition on line 100 was always true

101 self._value += 16