Skip to content

Commit ddb9b93

Browse files
committed
Refs #21382. Apply suggestions
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
1 parent 846d225 commit ddb9b93

6 files changed

Lines changed: 51 additions & 56 deletions

File tree

fastdds_python/test/api/test_datareader.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,20 +743,19 @@ def test_get_set_listener(datareader):
743743
assert(fastdds.StatusMask.all() ==
744744
datareader.get_status_mask())
745745

746-
def test(status_mask_1):
746+
def test(status_mask):
747747
"""
748748
Test the entity creation using the type of StatusMask.
749749
"""
750750
listener = DataReaderListener()
751751
assert(listener is not None)
752752
assert(fastdds.RETCODE_OK ==
753-
datareader.set_listener(listener, status_mask_1))
753+
datareader.set_listener(listener, status_mask))
754754
assert(datareader.get_listener() == listener)
755-
assert(status_mask_1 == datareader.get_status_mask())
755+
assert(status_mask == datareader.get_status_mask())
756756

757757
# Overload 2: Different status masks
758758
test(fastdds.StatusMask.all())
759-
test(fastdds.StatusMask.all())
760759
test(fastdds.StatusMask.none())
761760
test(fastdds.StatusMask.data_available())
762761
test(fastdds.StatusMask.data_on_readers())

fastdds_python/test/api/test_datawriter.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,20 +253,19 @@ def test_get_set_listener(datawriter):
253253
assert(datawriter.get_listener() == listener)
254254
assert(fastdds.StatusMask.all() == datawriter.get_status_mask())
255255

256-
def test(status_mask_1):
256+
def test(status_mask):
257257
"""
258-
Test the entity creation using the two types of StatusMasks.
258+
Test the entity creation using the type of StatusMask.
259259
"""
260260
listener = DataWriterListener()
261261
assert(listener is not None)
262262
assert(fastdds.RETCODE_OK ==
263-
datawriter.set_listener(listener, status_mask_1))
263+
datawriter.set_listener(listener, status_mask))
264264
assert(datawriter.get_listener() == listener)
265-
assert(status_mask_1 == datawriter.get_status_mask())
265+
assert(status_mask == datawriter.get_status_mask())
266266

267267
# Overload 2: Different status masks
268268
test(fastdds.StatusMask.all())
269-
test(fastdds.StatusMask.all())
270269
test(fastdds.StatusMask.none())
271270
test(fastdds.StatusMask.data_available())
272271
test(fastdds.StatusMask.data_on_readers())

fastdds_python/test/api/test_domainparticipant.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ def test_create_publisher(participant):
107107
assert(fastdds.RETCODE_OK ==
108108
participant.delete_publisher(publisher))
109109

110-
def test(status_mask_1, listnr=None):
110+
def test(status_mask, listnr=None):
111111
"""
112112
Test the entity creation using the type of StatusMask.
113113
"""
114114
publisher = participant.create_publisher(
115-
fastdds.PUBLISHER_QOS_DEFAULT, listnr, status_mask_1)
115+
fastdds.PUBLISHER_QOS_DEFAULT, listnr, status_mask)
116116
assert(publisher is not None)
117117
assert(publisher.is_enabled())
118-
assert(status_mask_1 == publisher.get_status_mask())
118+
assert(status_mask == publisher.get_status_mask())
119119
assert(fastdds.RETCODE_OK ==
120120
participant.delete_publisher(publisher))
121121

@@ -192,17 +192,17 @@ def test_create_publisher_with_profile(participant):
192192
assert(fastdds.RETCODE_OK ==
193193
participant.delete_publisher(publisher))
194194

195-
def test(status_mask_1, listnr=None):
195+
def test(status_mask, listnr=None):
196196
"""
197197
Test the entity creation using the type of StatusMask.
198198
"""
199199
publisher = participant.create_publisher_with_profile(
200-
'test_publisher_profile', listnr, status_mask_1)
200+
'test_publisher_profile', listnr, status_mask)
201201
assert(publisher is not None)
202202
assert(publisher.is_enabled())
203203
qos = publisher.get_qos()
204204
assert('partition_name_c' == qos.partition()[0])
205-
assert(status_mask_1 == publisher.get_status_mask())
205+
assert(status_mask == publisher.get_status_mask())
206206
assert(fastdds.RETCODE_OK ==
207207
participant.delete_publisher(publisher))
208208

@@ -269,15 +269,15 @@ def test_create_subscriber(participant):
269269
assert(fastdds.RETCODE_OK ==
270270
participant.delete_subscriber(subscriber))
271271

272-
def test(status_mask_1, listnr=None):
272+
def test(status_mask, listnr=None):
273273
"""
274274
Test the entity creation using the type of StatusMask.
275275
"""
276276
subscriber = participant.create_subscriber(
277-
fastdds.SUBSCRIBER_QOS_DEFAULT, listnr, status_mask_1)
277+
fastdds.SUBSCRIBER_QOS_DEFAULT, listnr, status_mask)
278278
assert(subscriber is not None)
279279
assert(subscriber.is_enabled())
280-
assert(status_mask_1 == subscriber.get_status_mask())
280+
assert(status_mask == subscriber.get_status_mask())
281281
assert(fastdds.RETCODE_OK ==
282282
participant.delete_subscriber(subscriber))
283283

@@ -354,17 +354,17 @@ def test_create_subscriber_with_profile(participant):
354354
assert(fastdds.RETCODE_OK ==
355355
participant.delete_subscriber(subscriber))
356356

357-
def test(status_mask_1, listnr=None):
357+
def test(status_mask, listnr=None):
358358
"""
359359
Test the entity creation using the type of StatusMask.
360360
"""
361361
subscriber = participant.create_subscriber_with_profile(
362-
'test_subscriber_profile', listnr, status_mask_1)
362+
'test_subscriber_profile', listnr, status_mask)
363363
assert(subscriber is not None)
364364
assert(subscriber.is_enabled())
365365
qos = subscriber.get_qos()
366366
assert('partition_name_b' == qos.partition()[0])
367-
assert(status_mask_1 == subscriber.get_status_mask())
367+
assert(status_mask == subscriber.get_status_mask())
368368
assert(fastdds.RETCODE_OK ==
369369
participant.delete_subscriber(subscriber))
370370

@@ -445,16 +445,16 @@ def test_create_and_delete_topic(participant):
445445
assert(fastdds.RETCODE_OK ==
446446
participant.delete_topic(topic))
447447

448-
def test(status_mask_1, listnr=None):
448+
def test(status_mask, listnr=None):
449449
"""
450450
Test the entity creation using the type of StatusMask.
451451
"""
452452
topic = participant.create_topic(
453453
"Complete", test_type.get_type_name(),
454-
fastdds.TOPIC_QOS_DEFAULT, listnr, status_mask_1)
454+
fastdds.TOPIC_QOS_DEFAULT, listnr, status_mask)
455455
assert(topic is not None)
456456
assert(topic.is_enabled())
457-
assert(status_mask_1 == topic.get_status_mask())
457+
assert(status_mask == topic.get_status_mask())
458458
assert(fastdds.RETCODE_OK ==
459459
participant.delete_topic(topic))
460460

@@ -641,20 +641,19 @@ def test_get_set_listener(participant):
641641
assert(participant.get_listener() == listener)
642642
assert(fastdds.StatusMask.all() == participant.get_status_mask())
643643

644-
def test(status_mask_1):
644+
def test(status_mask):
645645
"""
646646
Test the entity creation using the type of StatusMask.
647647
"""
648648
listener = DomainParticipantListener()
649649
assert(listener is not None)
650650
assert(fastdds.RETCODE_OK ==
651-
participant.set_listener(listener, status_mask_1))
651+
participant.set_listener(listener, status_mask))
652652
assert(participant.get_listener() == listener)
653-
assert(status_mask_1 == participant.get_status_mask())
653+
assert(status_mask == participant.get_status_mask())
654654

655655
# Overload 3: Different status masks
656656
test(fastdds.StatusMask.all())
657-
test(fastdds.StatusMask.all())
658657
test(fastdds.StatusMask.none())
659658
test(fastdds.StatusMask.data_available())
660659
test(fastdds.StatusMask.data_on_readers())

fastdds_python/test/api/test_domainparticipantfactory.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ def test_create_participant():
3131
assert(fastdds.RETCODE_OK ==
3232
factory.delete_participant(participant))
3333

34-
def test(status_mask_1, listnr=None):
34+
def test(status_mask, listnr=None):
3535
"""
3636
Test the entity creation using the type of StatusMask.
3737
"""
3838
participant = factory.create_participant(
39-
0, fastdds.PARTICIPANT_QOS_DEFAULT, listnr, status_mask_1)
39+
0, fastdds.PARTICIPANT_QOS_DEFAULT, listnr, status_mask)
4040
assert(participant is not None)
4141
assert(participant.is_enabled())
42-
assert(status_mask_1 == participant.get_status_mask())
42+
assert(status_mask == participant.get_status_mask())
4343
assert(fastdds.RETCODE_OK ==
4444
factory.delete_participant(participant))
4545

@@ -151,28 +151,28 @@ def test_create_participant_with_profile():
151151
assert(fastdds.RETCODE_OK ==
152152
factory.delete_participant(participant))
153153

154-
def test(status_mask_1, listnr=None):
154+
def test(status_mask, listnr=None):
155155
"""
156156
Test the entity creation using the type of StatusMask.
157157
"""
158158
participant = factory.create_participant_with_profile(
159-
'test_participant_profile', listnr, status_mask_1)
159+
'test_participant_profile', listnr, status_mask)
160160
assert(participant is not None)
161161
assert(participant.is_enabled())
162162
assert(3 == participant.get_domain_id())
163163
qos = participant.get_qos()
164164
assert('test_name' == qos.name())
165-
assert(status_mask_1 == participant.get_status_mask())
165+
assert(status_mask == participant.get_status_mask())
166166
assert(fastdds.RETCODE_OK ==
167167
factory.delete_participant(participant))
168168
participant = factory.create_participant_with_profile(
169-
0, 'test_participant_profile', listnr, status_mask_1)
169+
0, 'test_participant_profile', listnr, status_mask)
170170
assert(participant is not None)
171171
assert(participant.is_enabled())
172172
assert(0 == participant.get_domain_id())
173173
qos = participant.get_qos()
174174
assert('test_name' == qos.name())
175-
assert(status_mask_1 == participant.get_status_mask())
175+
assert(status_mask == participant.get_status_mask())
176176
assert(fastdds.RETCODE_OK ==
177177
factory.delete_participant(participant))
178178

fastdds_python/test/api/test_publisher.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ def test_create_datawriter(topic, publisher):
124124
assert(fastdds.RETCODE_OK ==
125125
publisher.delete_datawriter(datawriter))
126126

127-
def test(status_mask_1, listnr=None):
127+
def test(status_mask, listnr=None):
128128
"""
129129
Test the entity creation using the type of StatusMask.
130130
"""
131131
datawriter = publisher.create_datawriter(
132-
topic, fastdds.DATAWRITER_QOS_DEFAULT, listnr, status_mask_1)
132+
topic, fastdds.DATAWRITER_QOS_DEFAULT, listnr, status_mask)
133133
assert(datawriter is not None)
134134
assert(datawriter.is_enabled())
135-
assert(status_mask_1 == datawriter.get_status_mask())
135+
assert(status_mask == datawriter.get_status_mask())
136136
assert(fastdds.RETCODE_OK ==
137137
publisher.delete_datawriter(datawriter))
138138

@@ -211,18 +211,18 @@ def test_create_datawriter_with_profile(topic, publisher):
211211
assert(fastdds.RETCODE_OK ==
212212
publisher.delete_datawriter(datawriter))
213213

214-
def test(status_mask_1, listnr=None):
214+
def test(status_mask, listnr=None):
215215
"""
216216
Test the entity creation using the two types of StatusMasks.
217217
"""
218218
datawriter = publisher.create_datawriter_with_profile(
219-
topic, 'test_datawriter_profile', listnr, status_mask_1)
219+
topic, 'test_datawriter_profile', listnr, status_mask)
220220
assert(datawriter is not None)
221221
assert(datawriter.is_enabled())
222222
qos = datawriter.get_qos()
223223
assert(fastdds.VOLATILE_DURABILITY_QOS ==
224224
qos.durability().kind)
225-
assert(status_mask_1 == datawriter.get_status_mask())
225+
assert(status_mask == datawriter.get_status_mask())
226226
assert(fastdds.RETCODE_OK ==
227227
publisher.delete_datawriter(datawriter))
228228

@@ -378,20 +378,19 @@ def test_get_set_listener(publisher):
378378
assert(publisher.get_listener() == listener)
379379
assert(fastdds.StatusMask.all() == publisher.get_status_mask())
380380

381-
def test(status_mask_1):
381+
def test(status_mask):
382382
"""
383383
Test the entity creation using the type of StatusMask.
384384
"""
385385
listener = PublisherListener()
386386
assert(listener is not None)
387387
assert(fastdds.RETCODE_OK ==
388-
publisher.set_listener(listener, status_mask_1))
388+
publisher.set_listener(listener, status_mask))
389389
assert(publisher.get_listener() == listener)
390-
assert(status_mask_1 == publisher.get_status_mask())
390+
assert(status_mask == publisher.get_status_mask())
391391

392392
# Overload 2: Different status masks
393393
test(fastdds.StatusMask.all())
394-
test(fastdds.StatusMask.all())
395394
test(fastdds.StatusMask.none())
396395
test(fastdds.StatusMask.data_available())
397396
test(fastdds.StatusMask.data_on_readers())

fastdds_python/test/api/test_subscriber.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,15 @@ def test_create_datareader(topic, subscriber):
127127
assert(fastdds.RETCODE_OK ==
128128
subscriber.delete_datareader(datareader))
129129

130-
def test(status_mask_1, listnr=None):
130+
def test(status_mask, listnr=None):
131131
"""
132132
Test the entity creation using the type of StatusMask.
133133
"""
134134
datareader = subscriber.create_datareader(
135-
topic, fastdds.DATAREADER_QOS_DEFAULT, listnr, status_mask_1)
135+
topic, fastdds.DATAREADER_QOS_DEFAULT, listnr, status_mask)
136136
assert(datareader is not None)
137137
assert(datareader.is_enabled())
138-
assert(status_mask_1 == datareader.get_status_mask())
138+
assert(status_mask == datareader.get_status_mask())
139139
assert(fastdds.RETCODE_OK ==
140140
subscriber.delete_datareader(datareader))
141141

@@ -214,18 +214,18 @@ def test_create_datareader_with_profile(topic, subscriber):
214214
assert(fastdds.RETCODE_OK ==
215215
subscriber.delete_datareader(datareader))
216216

217-
def test(status_mask_1, listnr=None):
217+
def test(status_mask, listnr=None):
218218
"""
219219
Test the entity creation using the type of StatusMask.
220220
"""
221221
datareader = subscriber.create_datareader_with_profile(
222-
topic, 'test_datareader_profile', listnr, status_mask_1)
222+
topic, 'test_datareader_profile', listnr, status_mask)
223223
assert(datareader is not None)
224224
assert(datareader.is_enabled())
225225
qos = datareader.get_qos()
226226
assert(fastdds.RELIABLE_RELIABILITY_QOS ==
227227
qos.reliability().kind)
228-
assert(status_mask_1 == datareader.get_status_mask())
228+
assert(status_mask == datareader.get_status_mask())
229229
assert(fastdds.RETCODE_OK ==
230230
subscriber.delete_datareader(datareader))
231231

@@ -377,20 +377,19 @@ def test_get_set_listener(subscriber):
377377
assert(subscriber.get_listener() == listener)
378378
assert(fastdds.StatusMask.all() == subscriber.get_status_mask())
379379

380-
def test(status_mask_1):
380+
def test(status_mask):
381381
"""
382382
Test the entity creation using the type of StatusMask.
383383
"""
384384
listener = SubscriberListener()
385385
assert(listener is not None)
386386
assert(fastdds.RETCODE_OK ==
387-
subscriber.set_listener(listener, status_mask_1))
387+
subscriber.set_listener(listener, status_mask))
388388
assert(subscriber.get_listener() == listener)
389-
assert(status_mask_1 == subscriber.get_status_mask())
389+
assert(status_mask == subscriber.get_status_mask())
390390

391391
# Overload 2: Different status masks
392392
test(fastdds.StatusMask.all())
393-
test(fastdds.StatusMask.all())
394393
test(fastdds.StatusMask.none())
395394
test(fastdds.StatusMask.data_available())
396395
test(fastdds.StatusMask.data_on_readers())

0 commit comments

Comments
 (0)