Skip to content

Commit 5ab016b

Browse files
init (#1358)
Signed-off-by: Michael Carlstrom <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent c009b0d commit 5ab016b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+501
-501
lines changed

rclpy/test/test_action_client.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
TIME_FUDGE = 0.3
3232

3333

34-
class MockActionServer():
34+
class MockActionServer:
3535

3636
def __init__(self, node):
3737
self.goal_srv = node.create_service(
@@ -82,7 +82,7 @@ def tearDownClass(cls):
8282
cls.node.destroy_node()
8383
rclpy.shutdown(context=cls.context)
8484

85-
def setUp(self):
85+
def setUp(self) -> None:
8686
self.feedback = None
8787

8888
def feedback_callback(self, feedback):
@@ -93,12 +93,12 @@ def timed_spin(self, duration):
9393
while (time.time() - start_time) < duration:
9494
rclpy.spin_once(self.node, executor=self.executor, timeout_sec=0.1)
9595

96-
def test_constructor_defaults(self):
96+
def test_constructor_defaults(self) -> None:
9797
# Defaults
9898
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
9999
ac.destroy()
100100

101-
def test_constructor_no_defaults(self):
101+
def test_constructor_no_defaults(self) -> None:
102102
ac = ActionClient(
103103
self.node,
104104
Fibonacci,
@@ -111,7 +111,7 @@ def test_constructor_no_defaults(self):
111111
)
112112
ac.destroy()
113113

114-
def test_get_num_entities(self):
114+
def test_get_num_entities(self) -> None:
115115
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
116116
num_entities = ac.get_num_entities()
117117
self.assertEqual(num_entities.num_subscriptions, 2)
@@ -121,7 +121,7 @@ def test_get_num_entities(self):
121121
self.assertEqual(num_entities.num_services, 0)
122122
ac.destroy()
123123

124-
def test_wait_for_server_nowait(self):
124+
def test_wait_for_server_nowait(self) -> None:
125125
ac = ActionClient(self.node, Fibonacci, 'not_fibonacci')
126126
try:
127127
start = time.monotonic()
@@ -132,7 +132,7 @@ def test_wait_for_server_nowait(self):
132132
finally:
133133
ac.destroy()
134134

135-
def test_wait_for_server_timeout(self):
135+
def test_wait_for_server_timeout(self) -> None:
136136
ac = ActionClient(self.node, Fibonacci, 'not_fibonacci')
137137
try:
138138
start = time.monotonic()
@@ -143,7 +143,7 @@ def test_wait_for_server_timeout(self):
143143
finally:
144144
ac.destroy()
145145

146-
def test_wait_for_server_exists(self):
146+
def test_wait_for_server_exists(self) -> None:
147147
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
148148
try:
149149
start = time.monotonic()
@@ -154,7 +154,7 @@ def test_wait_for_server_exists(self):
154154
finally:
155155
ac.destroy()
156156

157-
def test_send_goal_async(self):
157+
def test_send_goal_async(self) -> None:
158158
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
159159
try:
160160
self.assertTrue(ac.wait_for_server(timeout_sec=2.0))
@@ -166,7 +166,7 @@ def test_send_goal_async(self):
166166
finally:
167167
ac.destroy()
168168

169-
def test_send_goal_async_with_feedback_after_goal(self):
169+
def test_send_goal_async_with_feedback_after_goal(self) -> None:
170170
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
171171
try:
172172
self.assertTrue(ac.wait_for_server(timeout_sec=2.0))
@@ -186,7 +186,7 @@ def test_send_goal_async_with_feedback_after_goal(self):
186186
finally:
187187
ac.destroy()
188188

189-
def test_send_goal_async_with_feedback_before_goal(self):
189+
def test_send_goal_async_with_feedback_before_goal(self) -> None:
190190
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
191191
try:
192192
self.assertTrue(ac.wait_for_server(timeout_sec=2.0))
@@ -209,7 +209,7 @@ def test_send_goal_async_with_feedback_before_goal(self):
209209
finally:
210210
ac.destroy()
211211

212-
def test_send_goal_async_with_feedback_after_goal_result_requested(self):
212+
def test_send_goal_async_with_feedback_after_goal_result_requested(self) -> None:
213213
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
214214
try:
215215
self.assertTrue(ac.wait_for_server(timeout_sec=2.0))
@@ -235,7 +235,7 @@ def test_send_goal_async_with_feedback_after_goal_result_requested(self):
235235
finally:
236236
ac.destroy()
237237

238-
def test_send_goal_async_with_feedback_for_another_goal(self):
238+
def test_send_goal_async_with_feedback_for_another_goal(self) -> None:
239239
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
240240
try:
241241
self.assertTrue(ac.wait_for_server(timeout_sec=2.0))
@@ -266,7 +266,7 @@ def test_send_goal_async_with_feedback_for_another_goal(self):
266266
finally:
267267
ac.destroy()
268268

269-
def test_send_goal_async_with_feedback_for_not_a_goal(self):
269+
def test_send_goal_async_with_feedback_for_not_a_goal(self) -> None:
270270
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
271271
try:
272272
self.assertTrue(ac.wait_for_server(timeout_sec=2.0))
@@ -286,7 +286,7 @@ def test_send_goal_async_with_feedback_for_not_a_goal(self):
286286
finally:
287287
ac.destroy()
288288

289-
def test_send_goal_multiple(self):
289+
def test_send_goal_multiple(self) -> None:
290290
ac = ActionClient(
291291
self.node,
292292
Fibonacci,
@@ -310,7 +310,7 @@ def test_send_goal_multiple(self):
310310
finally:
311311
ac.destroy()
312312

313-
def test_send_goal_async_no_server(self):
313+
def test_send_goal_async_no_server(self) -> None:
314314
ac = ActionClient(self.node, Fibonacci, 'not_fibonacci')
315315
try:
316316
future = ac.send_goal_async(Fibonacci.Goal())
@@ -319,7 +319,7 @@ def test_send_goal_async_no_server(self):
319319
finally:
320320
ac.destroy()
321321

322-
def test_send_cancel_async(self):
322+
def test_send_cancel_async(self) -> None:
323323
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
324324
try:
325325
self.assertTrue(ac.wait_for_server(timeout_sec=2.0))
@@ -340,7 +340,7 @@ def test_send_cancel_async(self):
340340
finally:
341341
ac.destroy()
342342

343-
def test_get_result_async(self):
343+
def test_get_result_async(self) -> None:
344344
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
345345
try:
346346
self.assertTrue(ac.wait_for_server(timeout_sec=2.0))
@@ -358,7 +358,7 @@ def test_get_result_async(self):
358358
finally:
359359
ac.destroy()
360360

361-
def test_different_type_raises(self):
361+
def test_different_type_raises(self) -> None:
362362
ac = ActionClient(self.node, Fibonacci, 'fibonacci')
363363
try:
364364
with self.assertRaises(TypeError):

rclpy/test/test_action_graph.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def get_names_and_types(
8787
end = time.monotonic()
8888
assert len(nat) == expected_num_names
8989

90-
def test_get_action_client_names_and_types_by_node(self):
90+
def test_get_action_client_names_and_types_by_node(self) -> None:
9191
self.get_names_and_types(
9292
get_action_client_names_and_types_by_node,
9393
self.node1,
@@ -128,7 +128,7 @@ def test_get_action_client_names_and_types_by_node(self):
128128
assert TEST_NAMESPACE2 + '/' + TEST_ACTION0 in [name20, name21]
129129
assert TEST_NAMESPACE2 + '/' + TEST_ACTION1 in [name20, name21]
130130

131-
def test_get_action_server_names_and_types_by_node(self):
131+
def test_get_action_server_names_and_types_by_node(self) -> None:
132132
self.get_names_and_types(
133133
get_action_server_names_and_types_by_node,
134134
self.node1,
@@ -170,7 +170,7 @@ def test_get_action_server_names_and_types_by_node(self):
170170
assert TEST_NAMESPACE2 + '/' + TEST_ACTION0 in [name20, name21]
171171
assert TEST_NAMESPACE2 + '/' + TEST_ACTION1 in [name20, name21]
172172

173-
def test_get_action_names_and_types(self):
173+
def test_get_action_names_and_types(self) -> None:
174174
names_and_types = self.get_names_and_types(
175175
get_action_names_and_types,
176176
self.node0,

0 commit comments

Comments
 (0)