From 35466d5afffbbf720b987d3d8136a07cc73100b9 Mon Sep 17 00:00:00 2001 From: Miguel Barro Date: Tue, 16 Aug 2022 11:46:50 +0200 Subject: [PATCH] Refs 15319. Fix test coverage Signed-off-by: Miguel Barro --- fastdds_python/test/api/test_waitset.py | 39 +++++++++++++------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/fastdds_python/test/api/test_waitset.py b/fastdds_python/test/api/test_waitset.py index dadc6cbb..57937ad2 100644 --- a/fastdds_python/test/api/test_waitset.py +++ b/fastdds_python/test/api/test_waitset.py @@ -114,30 +114,33 @@ def test_waitset(datareader, datawriter): assert(3 == len(attached_conds)) for c in attached_conds: if ('StatusCondition' == str(c)): - try: - attached_status_cond = c.to_guard_condition() - attached_status_cond = c.to_read_condition() - assert(False) - except TypeError: - pass + for m in [c.to_guard_condition, c.to_read_condition]: + try: + m() + assert(False) + except TypeError: + pass + attached_status_cond = c.to_status_condition() assert(status_cond == attached_status_cond) elif ('GuardCondition' == str(c)): - try: - attached_guard_cond = c.to_status_condition() - attached_guard_cond = c.to_read_condition() - assert(False) - except TypeError: - pass + for m in [c.to_status_condition, c.to_read_condition]: + try: + m() + assert(False) + except TypeError: + pass + attached_guard_cond = c.to_guard_condition() assert(guard_cond == attached_guard_cond) elif ('ReadCondition' == str(c)): - try: - attached_read_cond = c.to_status_condition() - attached_read_cond = c.to_guard_condition() - assert(False) - except TypeError: - pass + for m in [c.to_status_condition, c.to_guard_condition]: + try: + m() + assert(False) + except TypeError: + pass + attached_read_cond = c.to_read_condition() assert(read_cond == attached_read_cond)