mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-15 08:47:16 +02:00
updates tests
This commit is contained in:
@ -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()
|
||||
|
||||
|
Reference in New Issue
Block a user