Coverage for myPackage/__init__.py: 77%

43 statements  

« prev     ^ index     » next       coverage.py v7.10.7, created at 2025-10-01 16:45 +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 subprocess import check_call 

44 

45from pyTooling.Decorators import export, readonly 

46from pyTooling.Platform import Platform 

47 

48 

49@export 

50class Base: 

51 """ 

52 A base-class for dummy applications. 

53 """ 

54 

55 _value: int #: An internal value. 

56 

57 def __init__(self) -> None: 

58 # """ 

59 # Initializes the base-class. 

60 # """ 

61 self._value = 0 

62 

63 @readonly 

64 def Value(self) -> int: 

65 """ 

66 Read-only property to return the internal value. 

67 

68 :return: Internal value. 

69 """ 

70 return self._value 

71 

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

73 """ 

74 Accumulate value to internal value. 

75 

76 :param value: Value to accumulate. 

77 """ 

78 self._value += value 

79 

80 

81@export 

82class Application(Base): 

83 """ 

84 A dummy application for demonstration purposes. 

85 """ 

86 

87 def __init__(self) -> None: 

88 # """ 

89 # Initializes the dummy application. 

90 # """ 

91 super().__init__() 

92 

93 platform = Platform() 

94 # pylint: disable=using-constant-test 

95 if platform.IsNativeLinux: 

96 self._value += 1 

97 elif platform.IsNativeMacOS: 

98 self._value += 2 

99 elif platform.IsNativeWindows: 

100 self._value += 3 

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

102 self._value += 11 

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

104 self._value += 12 

105 elif platform.IsMinGW64OnWindows: 

106 self._value += 13 

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

108 self._value += 14 

109 elif platform.IsClang32OnWindows: 

110 self._value += 15 

111 elif platform.IsClang64OnWindows: 

112 self._value += 16