Coverage for myPackage/__init__.py: 77%

44 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-19 22:50 +0000

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

2# _____ _ _ _ _ _ # 

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

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

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

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

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

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

9# Authors: # 

10# Patrick Lehmann # 

11# # 

12# License: # 

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

14# Copyright 2017-2025 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-2025, Patrick Lehmann" 

38__license__ = "Apache License, Version 2.0" 

39__version__ = "0.4.5" 

40__keywords__ = ["GitHub Actions"] 

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

42 

43from pickle import dumps 

44from subprocess import check_call 

45 

46from pyTooling.Decorators import export, readonly 

47from pyTooling.Platform import Platform 

48 

49 

50@export 

51class Base: 

52 """ 

53 A base-class for dummy applications. 

54 """ 

55 

56 _value: int #: An internal value. 

57 

58 def __init__(self) -> None: 

59 # """ 

60 # Initializes the base-class. 

61 # """ 

62 self._value = 0 

63 

64 @readonly 

65 def Value(self) -> int: 

66 """ 

67 Read-only property to return the internal value. 

68 

69 :return: Internal value. 

70 """ 

71 return self._value 

72 

73 def Add(self, value) -> None: 

74 """ 

75 Accumulate value to internal value. 

76 

77 :param value: Value to accumulate. 

78 """ 

79 self._value += value 

80 

81 

82@export 

83class Application(Base): 

84 """ 

85 A dummy application for demonstration purposes. 

86 """ 

87 

88 def __init__(self) -> None: 

89 # """ 

90 # Initializes the dummy application. 

91 # """ 

92 super().__init__() 

93 

94 platform = Platform() 

95 # pylint: disable=using-constant-test 

96 if platform.IsNativeLinux: 

97 self._value += 1 

98 elif platform.IsNativeMacOS: 

99 self._value += 2 

100 elif platform.IsNativeWindows: 

101 self._value += 3 

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

103 self._value += 11 

104 elif platform.IsMinGW32OnWindows: 104 ↛ 105line 104 didn't jump to line 105 because the condition on line 104 was never true

105 self._value += 12 

106 elif platform.IsMinGW64OnWindows: 

107 self._value += 13 

108 elif platform.IsUCRT64OnWindows: 108 ↛ 110line 108 didn't jump to line 110 because the condition on line 108 was always true

109 self._value += 14 

110 elif platform.IsClang32OnWindows: 

111 self._value += 15 

112 elif platform.IsClang64OnWindows: 

113 self._value += 16