Skip to content

Commit 67a866c

Browse files
Add type hints to Service properties
1 parent ec4c643 commit 67a866c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testinfra/modules/service.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ def __init__(self, name):
3434
super().__init__()
3535

3636
@property
37-
def exists(self):
37+
def exists(self) -> bool:
3838
"""Test if the service exists"""
3939
raise NotImplementedError
4040

4141
@property
42-
def is_running(self):
42+
def is_running(self) -> bool:
4343
"""Test if service is running"""
4444
raise NotImplementedError
4545

4646
@property
47-
def is_enabled(self):
47+
def is_enabled(self) -> bool:
4848
"""Test if service is enabled"""
4949
raise NotImplementedError
5050

5151
@property
52-
def is_valid(self):
52+
def is_valid(self) -> bool:
5353
"""Test if service is valid
5454
5555
This method is only available in the systemd implementation,
@@ -58,7 +58,7 @@ def is_valid(self):
5858
raise NotImplementedError
5959

6060
@property
61-
def is_masked(self):
61+
def is_masked(self) -> bool:
6262
"""Test if service is masked
6363
6464
This method is only available in the systemd implementation,
@@ -67,7 +67,7 @@ def is_masked(self):
6767
raise NotImplementedError
6868

6969
@functools.cached_property
70-
def systemd_properties(self):
70+
def systemd_properties(self) -> dict[str, str]:
7171
"""Properties of the service (unit).
7272
7373
Return service properties as a `dict`,

0 commit comments

Comments
 (0)