From 75cae5aff026ce4c6285f2de39aba9f709dd6ac5 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 13 Aug 2019 15:30:15 -0400 Subject: [PATCH] tests: return 0 instead of None for unknown file in test component class support-info query I noticed some spurious warnings while running TestAutoDiscoverSourceComponentSpecsGrouping.test_grouping (shortened for brevity): unexpected result type: component-class-name=source.test.TestSourceExt, input=/home/smarchi/src/babeltrace/tests/data/auto-source-discovery/grouping/bt_plugin_test.py, input-type=file, expected-types=REAL,MAP,SIGNED_INTEGER, actual-type=NULL Indeed, the _query method of TestSourceExt fails to return a value (so it returns None) if it doesn't know the file. This is not on purpose in this test, so fix it. Change-Id: I303c78dae4a518c62573263aa7a3afafd0c61ed7 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/1906 Reviewed-by: Philippe Proulx Tested-by: jenkins --- tests/data/auto-source-discovery/grouping/bt_plugin_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/auto-source-discovery/grouping/bt_plugin_test.py b/tests/data/auto-source-discovery/grouping/bt_plugin_test.py index 2495b502..a4d53dbd 100644 --- a/tests/data/auto-source-discovery/grouping/bt_plugin_test.py +++ b/tests/data/auto-source-discovery/grouping/bt_plugin_test.py @@ -76,8 +76,8 @@ class TestSourceExt(Base, bt2._UserSourceComponent, message_iterator_class=TestI return 1 else: return 1.0 - else: - return 0 + + return 0 else: raise bt2.UnknownObject -- 2.34.1