From: Simon Marchi Date: Tue, 13 Aug 2019 19:30:15 +0000 (-0400) Subject: tests: return 0 instead of None for unknown file in test component class support... X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=75cae5aff026ce4c6285f2de39aba9f709dd6ac5;hp=00f637fdc6e017cfd6969ad81d11b35c0e98ab39;p=babeltrace.git 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 --- 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