Initial commit

This commit is contained in:
Mose Müller
2023-08-02 12:06:19 +02:00
parent cda7955934
commit b67c0f9da3
19 changed files with 1868 additions and 0 deletions

34
tests/test_properties.py Normal file
View File

@ -0,0 +1,34 @@
from pytest import CaptureFixture
from pyDataInterface import DataService
def test_properties(capsys: CaptureFixture) -> None:
class ServiceClass(DataService):
_power = True
@property
def power(self) -> bool:
return self._power
@power.setter
def power(self, value: bool) -> None:
self._power = value
@property
def power_two(self) -> bool:
return self._power
test_service = ServiceClass()
test_service.power = False
captured = capsys.readouterr()
expected_output = sorted(
[
"ServiceClass.power = False",
"ServiceClass.power_two = False",
"ServiceClass._power = False",
]
)
actual_output = sorted(captured.out.strip().split("\n"))
assert actual_output == expected_output