File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,6 +113,30 @@ def test_signature_must_be_string():
113113 dbus_property (signature = 5 )
114114
115115
116+ def test_method_without_signature_requires_annotations ():
117+ def no_annotation (self , value ) -> None :
118+ return None
119+
120+ with pytest .raises (ValueError , match = "method parameters must specify" ):
121+ dbus_method ()(no_annotation )
122+
123+
124+ def test_property_signature_must_be_single_complete_type ():
125+ def getter (self ) -> int :
126+ return 0
127+
128+ with pytest .raises (ValueError , match = "single complete type" ):
129+ dbus_property (signature = "ss" )(getter )
130+
131+
132+ def test_property_without_signature_requires_return_annotation ():
133+ def getter (self ):
134+ return 0
135+
136+ with pytest .raises (ValueError , match = "return annotation" ):
137+ dbus_property ()(getter )
138+
139+
116140@pytest .mark .asyncio
117141async def test_decorator_signature_round_trip ():
118142 bus1 = await MessageBus ().connect ()
You can’t perform that action at this time.
0 commit comments