updates tests

This commit is contained in:
Mose Müller
2023-11-30 17:17:41 +01:00
parent cc105106ee
commit c891642bda
10 changed files with 563 additions and 465 deletions

View File

@ -1,28 +1,27 @@
from pydase import DataService
from pytest import LogCaptureFixture
from pydase import DataService
def test_setattr_warnings(caplog: LogCaptureFixture) -> None: # noqa
def test_setattr_warnings(caplog: LogCaptureFixture) -> None:
# def test_setattr_warnings(capsys: CaptureFixture) -> None:
class SubClass:
name = "Hello"
class ServiceClass(DataService):
def __init__(self) -> None:
self.attr_1 = SubClass()
super().__init__()
self.attr_1 = SubClass()
ServiceClass()
assert "Warning: Class 'SubClass' does not inherit from DataService." in caplog.text
def test_private_attribute_warning(caplog: LogCaptureFixture) -> None: # noqa
def test_private_attribute_warning(caplog: LogCaptureFixture) -> None:
class ServiceClass(DataService):
def __init__(self) -> None:
self.__something = ""
super().__init__()
self.__something = ""
ServiceClass()
@ -32,14 +31,14 @@ def test_private_attribute_warning(caplog: LogCaptureFixture) -> None: # noqa
)
def test_protected_attribute_warning(caplog: LogCaptureFixture) -> None: # noqa
def test_protected_attribute_warning(caplog: LogCaptureFixture) -> None:
class SubClass:
name = "Hello"
class ServiceClass(DataService):
def __init__(self) -> None:
self._subclass = SubClass
super().__init__()
self._subclass = SubClass
ServiceClass()